4 ms·
RPython is relevant. He does mention PyPy, which uses RPython, but I am surprised that he does not mention RPython itself -- a restricted subset of the Python
by josh_fyi 6y ago
RPython is relevant. He does mention PyPy, which uses RPython, but I am surprised that he does not mention RPython itself -- a restricted subset of the Python language used for similar purposes to the ones that he describes.
- albertzeyer 6y agoI was interested a while ago (2013...) in this question, whether RPython might be an interesting general language by itself. I asked about that in the pypy-dev mailing list. Unfortunately I cannot find a link to that thread, but here are some answers (from Armin Rigo and Carl Friedrich Bolz): > we (= the general PyPy developers) are not really interested in this direction [...]. There is notably the fact that RPython is not meant as a general language used to produce stand-alone C libraries. It's certainly possible to make one in theory, but cumbersome. > One of the reasons why the RPython project does not care much about this use case anymore is that we had a way to make CPython extensions. It was called the "extension compiler". It turned out to be a) extremely annoying to implement b) not very useful in practice. Thus a totally frustrating experience overall. > The reasons for slowness was mainly: when compiling RPython code to be a C extension module, reference counting is used to reclaim garbage. That is extremely slow. Therefore the modules never got the performance anybody expected. > When people look at RPython, an obvious feature is that it is syntactically identical to Python. "RPython must be an easy language, given that it has got the syntax of Python, which is easy". This is a common misconception. In fact, pleasing the automatic type inference process can be difficult. It requires the programmer keeping in his head the global types of his whole program, and carefully writing code according to these implicit types. The process is much harder for newcomers, which don't have any written-down example to learn how to manipulate the types --- precisely because they are implicit. > So this is the reason we are recommending against RPython now (and for many years now). Anybody who thinks RPython is as easy as Python is someone who will happily try out RPython and be burned alive by it. Edit: I found one link to the thread: https://mail.python.org/pipermail/pypy-dev/2013-June/011503.html https://mail.python.org/pipermail/pypy-dev/2013-June/011503.... Edit: I also found a (closed, opinion based, obviously...) related StackOverflow question: https://stackoverflow.com/questions/17134479/why-do-people-say-that-rpython-is-an-unpleasant-language-to-program-in/ https://stackoverflow.com/questions/17134479/why-do-people-s... From the FAQ (https://rpython.readthedocs.io/en/latest/faq.html https://rpython.readthedocs.io/en/latest/faq.html): > First and foremost, RPython is a language designed for writing interpreters. It is a restricted subset of Python. If your program is not an interpreter but tries to do “real things”, like use any part of the standard Python library or any 3rd-party library, then it is not RPython to start with. You should only look at RPython if you try to write your own interpreter. A related project (probably abandoned since a long time): https://code.google.com/archive/p/rpythonic/ https://code.google.com/archive/p/rpythonic/
- mkesper 6y agoThe typing issue should have changed to the better due to type annotations, right?
- Kednicma 6y agoNo, RPython doesn't support type annotations; it's a subset of Python 2.7. You basically have to write Java or Haskell but your types are globally checked and you have to guess at what will compile.
- imtringued 6y agoRPython is so restricted it prevents you from using most of the standard library.