3 ms·
How do projects like Pypy help this? I know Pypy wants to be able to build fast, cross-platform interpreters; but how close to reality is that?
by SoftwareMaven 14y ago
How do projects like Pypy help this? I know Pypy wants to be able to build fast, cross-platform interpreters; but how close to reality is that?
- corysama 14y agoYou can write an interpreter in RPython and PyPy will automatically generate a just-in-time compiler for your interpreter. http://morepypy.blogspot.com/2011/04/tutorial-writing-interpreter-with-pypy.html http://morepypy.blogspot.com/2011/04/tutorial-writing-interp... http://morepypy.blogspot.com/2011/04/tutorial-part-2-adding-jit.html http://morepypy.blogspot.com/2011/04/tutorial-part-2-adding-... http://tratt.net/laurie/tech_articles/articles/fast_enough_vms_in_fast_enough_time http://tratt.net/laurie/tech_articles/articles/fast_enough_v... http://tratt.net/laurie/research/talks/2012/kent_fast_enough.pdf http://tratt.net/laurie/research/talks/2012/kent_fast_enough...
- fijal 14y agoPyPy's focus so far has been on the JIT. The interpreter part is mostly an equivalent of a brain-dead C implementation. Overall it does not matter for long running programs (like web servers), but the warmup times are kind of horrible. That said, in a language like Python, the interpretation overhead matters much less, because bytecodes are typically very "fat" and involve say multiple dictionary lookups (which are way more costly than bytecode dispatch lookup). If I were to optimize the interpreter, I would start with specialized bytecodes, that avoids fatness of the bytecodes first.