3 ms·
Note that PyPy supported LLVM as a backend until recently. It didn't get nearly the love that the C backend did, apparently, and was removed because it wasn't
by stephenjudkins 17y ago
Note that PyPy supported LLVM as a backend until recently. It didn't get nearly the love that the C backend did, apparently, and was removed because it wasn't being maintained (see http://codespeak.net/pipermail/pypy-dev/2009q2/005143.html http://codespeak.net/pipermail/pypy-dev/2009q2/005143.html). It was apparently 5x slower than the C backend.
I believe the difference is that unladen-swallow generates python code (JIT) using LLVM, but PyPy generated the interpreter that way.
The JIT approach taken by PyPy is quite different than that taken by unladen-swallow or other projects. Once completed, it can supposedly "turn the interpreter of an arbitrary dynamic language into a just-in-time compiler for the same language". However, as far as I can tell, the only working "backend" for the JIT is x86. Why they don't leverage LLVM, I'm not sure, but it's likely that they have good reasons.
PyPy is a very cool idea in that it provides RPython (a non-dynamic subset of Python) as a DSL for creating dynamic languages. In theory, one could write clean, beautiful, intention-revealing code that specifies a language, while the JIT generator handles all the hard parts of making it fast. Unladen swallow has the much narrower goal of leveraging LLVM to make Python bytecode run faster.
Whether PyPy is too ambitious is hard to tell, but it's certainly way behind schedule from what they had hoped when the project began. It's certainly a really cool project that's worth keeping an eye on.
- sjs 17y agoThey are implementing the Futamura Projections. Very, very cool. I wouldn't be surprised if a lot of existing tools just weren't built for their needs. A fantastic explanation by sigfpe: http://blog.sigfpe.com/2009/05/three-projections-of-doctor-futamura.html http://blog.sigfpe.com/2009/05/three-projections-of-doctor-f... More generally: http://en.wikipedia.org/wiki/Partial_evaluation http://en.wikipedia.org/wiki/Partial_evaluation
- stcredzero 17y agoIn theory, one could write clean, beautiful, intention-revealing code that specifies a language, while the JIT generator handles all the hard parts of making it fast. It's not a theory. Squeak Smalltalk has been doing exactly that for years. (Not the JIT, but specifying the interpreter in a subset language.)
- fijal 17y agoThe reason why PyPy dropped llvm as an assembler backend is because llvm is a pain to deploy and use. We have an undergoing llvm backend, but there is a bit of unadressed issues and someone might want to take a look at it (http://codespeak.net/svn/pypy/trunk/pypy/jit/backend/llvm/ http://codespeak.net/svn/pypy/trunk/pypy/jit/backend/llvm/) if he wants to continue.