

The Magic of RPython - williamtrask
http://kirbyfan64.github.io/posts/the-magic-of-rpython.html

======
ahomescu1
I used RPython on my own interpreter project a few years ago (stopped working
on it around 2013). It's a very interesting approach to writing
interpreters/JIT compilers, and produces very fast code, but developing
RPython code was very painful for a few reasons (back then, maybe they got
fixed in the mean time):

1) Huge compilation times, and compilation is non-incremental. Making even a
small change to the source code causes it to be fully re-compiled, which on
our project took 15-20 minutes (I can only imagine how painful this is on
PyPy, which took me around 2 hours to build the time I tried it). I think the
root cause of this is the static analysis and type inference, which needs to
run again on the entire source code, and proved to be really slow on a huge
code base. This was painful for development, so much time wasted on waiting on
the compiler.

2) My experience with error messages was not as positive as the OP's.
Sometimes, I'd make a type error in the code and get a cryptic error message,
and have to guess by myself what caused it. Perhaps things have improved since
then (I see some new details in the errors in the article that weren't there
when I used RPython).

~~~
andrewchambers
The best way to work with it is to write tests which can run in interpreted
mode.

~~~
ahomescu1
If you mean run RPython code as regular Python code, that doesn't always catch
typing problems. For example, returning a None where an int is expected works
fine in Python, not so in RPython.

------
orf
RPython and PyPy are (IMO) the coolest Python projects out there. I made a
little Brainfuck intepreter with it and it was super simple, but making small
changes seemed to slow it down a lot. There is very little visibility as to
how the code is compiled - i.e should I use a list or a tuple for some things?
Can PyPy work out that a list is fixed sized? How should I classes to make
them as efficient as possible (like are classes with two or so fields passed
as structs)?

------
616c
The coolest example of RPython in action, after PyPy of course (but goes
without saying): Pixie, the lang and VM that is a native, high-speed Lisp.

[https://github.com/pixie-lang/pixie](https://github.com/pixie-lang/pixie)

------
masklinn
Note that, as far as I know (the rpython/pypy team will confirm or infirm)
RPython is _not_ intended to be a general-purpose python-like language. For
that you want cython or nim. RPython is a toolkit for building language VMs.
I'm guessing that's why relatively little work has gone into error reporting.

~~~
McElroy
I hadn't heard the word infirm before so I looked it up. It seems to me that
it does not mean what you think it means. Thought you might want to know that.
[http://www.merriam-webster.com/dictionary/infirm](http://www.merriam-
webster.com/dictionary/infirm)

~~~
blandinw
It's a mistake French (Latin?) speakers (myself included) often make:
[https://translate.google.com/m/translate#fr/en/infirmer](https://translate.google.com/m/translate#fr/en/infirmer)

------
cschmidt
I must say that RPython is not a very good name. I assumed it was a system for
R and python integration. Like say the RPython package
[http://rpython.r-forge.r-project.org](http://rpython.r-forge.r-project.org)

~~~
maroonblazer
Me too. Why not call it PythonC?

~~~
bbrazil
That could cause confusion with CPython (the main python implementation) and
possibly also Cython (C extensions for Python).

