[pypy-dev] Minimal VM

Paul Boddie paul at boddie.org.uk
Tue Jan 14 17:41:28 CET 2003

Christian Tismer <tismer at tismer.com> wrote:
>There will be a very tiny, portable little virtual
>machine written in C. It is not meant to be efficient,
>just enough to implement the bytecode interpreter.
>I'm right now tinkering with parts of such a beast.
>It is getting very small, just a few kilobytes executable.

The most interesting parts, it seems to me, will be those which implement the more complicated bytecode semantics (like LOAD_NAME, for example, which seems to have the potential to be pretty deep). Although you are bound to know much more about this than me - I've never looked at the Python VM source code - there must surely be a huge chunk of C code implementing the name lookup semantics.

>This thing will be able to interpret Python bytecode.

Without getting carried away by the promise of massive performance increases, an interesting application of a simplified VM should be the increased potential for reimplementations of the platform. It would be most amusing to be able to reduce the scope of VM operations such that they could be more easily implemented on "really small" computing platforms.

Of course, a side effect of having simpler VM operations (ie. simpler bytecode semantics) is that Psyco (or its successor) will have much more to play with, as more of the VM "magic" moves out of the VM and into bytecode routines which can then be specialised.

Anyway, those are my thoughts.


P.S. I wrote a similar analysis on Kendall Clark's Weblog at...


...for those of you who might think they've read this before.

Free 20MB Web Site Hosting and Personalized E-mail Service!
Get It Now At Doteasy.com http://www.doteasy.com/et/

More information about the Pypy-dev mailing list