|
|
Log in / Subscribe / Register

Tratt: Fast Enough VMs in Fast Enough Time

Tratt: Fast Enough VMs in Fast Enough Time

Posted Feb 10, 2012 23:29 UTC (Fri) by daglwn (guest, #65432)
In reply to: Tratt: Fast Enough VMs in Fast Enough Time by flewellyn
Parent article: Tratt: Fast Enough VMs in Fast Enough Time

It is very cool stuff. It's a form of of partial evaluation and the Futamura projections.

http://en.wikipedia.org/wiki/Partial_evaluation

RPython appears to essentially be an implementation of some of the Futamura projections.

So in RPython terms:

  • The tracing JIT performs/is projection #1; it creates the native code by specializing the interpreter against the source program, capturing the resulting instruction stream -- this is the "tracing" part.
  • The RPython compiler/implementation performs/is projection #2; given an interpreter it creates a compiler (tracing JIT) that can handle any input program.

Whether RPython actually specializes itself against the interpreter to create the tracing JIT determines whether it actually uses Futamura projection #2 to achieve its ends. My guess is that it's more "hard coded" than that and is not really using partial evaluation to do the work. I am curious to know, however.

This isn't to take anything away from the PyPy people. I don't know of any other such project as close to mainstream as PyPy is. That in itself is a monumental achievement. Taking things from the lab to production use is not easy.

Incidentally, RPython itself could have been created by applying the third projection:

  • Specializing the specializer for itself (as applied in #2), yielding a tool that can convert any interpreter to an equivalent compiler

Obviously I don't know if they built RPython this way (I suspect not) but this kind of tool has been known for some time. Theoretically one can take the CPython interpreter, write a couple of specializers and spit out a program that is essentially RPython.

There are also musings of a fourth projection, for example:

http://dl.acm.org/citation.cfm?id=1480954


The LWN site is currently under high scraper load, so comment display has been suppressed for anonymous users. If you are a human, you may read the comments by clicking the button below:

Note: you can avoid this step in the future by logging into your LWN account.


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