User: Password:
Subscribe / Log in / New account

PyPy: the other new compiler project

PyPy: the other new compiler project

Posted May 20, 2010 7:36 UTC (Thu) by hppnq (guest, #14462)
Parent article: PyPy: the other new compiler project

What really catches your editor's eye, though, is the concept of PyPy as a generalized compiler for the creation of JITs for high-level languages.

Insert obligatory reference to Parrot.

(Log in to post comments)

PyPy: the other new compiler project

Posted May 20, 2010 16:31 UTC (Thu) by intgr (subscriber, #39733) [Link]

Parrot is a single JIT, it restricts you to a certain virtual machine and bytecode format. PyPy is a framework for JITs, where adapting it to a new language/bytecode is no harder than writing an interpreter in RPython. In fact, you could directly turn source code into JIT-ed machine code without any intermediary bytecode (like Chrome's V8 JIT does for JavaScript).

Now I'm not at all convinced if this approach is a good thing. After all, it took many years to reach the PyPy 1.2 milestone and its optimization capabilities are still pretty primitive compared to other JITs.

PyPy: the other new compiler project

Posted May 20, 2010 18:49 UTC (Thu) by erwbgy (subscriber, #4104) [Link]

That means that the PyPy interpreter can be easily targeted to whatever runtime environment works best.

Presumably this means that PyPy could target the Parrot virtual machine if they wanted to.

PyPy: the other new compiler project

Posted May 20, 2010 23:08 UTC (Thu) by alvieboy (subscriber, #51617) [Link]

They can target parrot. But parrot is just another VM - although I'm very excited about it.

LLVM is also interesting, as a framework. Python, being pure OO is quite complex (let's say, quite large) on its specification. Unlike Perl, where you can use three basic types (all pointers) [SV,AV and HV] to perform almost everything you need (SV is quite complex, yes), in Python you do have to define a huge structure to handle even simple classes and simple methods. I almost gave up on python (for embedded script) for that same reason. LUA does not suit either. I ended up with nothing.

Now, regarding VM/compilers:

Other thing most of those VM/compilers/compiler generators assume is the general availability of registers. Although those exist in almost vast numbers in x86, ARM, MIPS, SH, you name it, other architectures like forth processors do not actually have registers. Everyone seems to assume registers exist and often emulation of those registers must be implemented to accomplish code or pseudocode generated.

I'd like to see a VM that implements algorithms instead of low-level register operations. That would be a fantastic innovation.

PyPy: the other new compiler project

Posted May 20, 2010 19:49 UTC (Thu) by wingo (guest, #26929) [Link]

Everyone who writes a compiler and VM eventually sees it as a toolkit that everyone else should use. I should know, I maintain Guile ;-)

Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds