Implementing my own Python interpreter

Stefan Behnel stefan_ml at behnel.de
Tue Oct 14 16:15:11 EDT 2008


Ognjen Bezanov wrote:
> Also, any pro's out there willing to chime on the feasibility of
> implementing python to run directly on the hardware (without an
> underlying OS)? I don't expect 100% compatibility, but would the basics
> (branching, looping, arithmatic) be feasible?

You should take a look at Cython, which translates Python code to C. It does
not build a complete Interpreter (it doesn't reimplement the data types and
their operations, for example), but it does implement most of the control flow
and a lot of other things that make the generated code fast. In case you come
to the conclusion that reimplementing Python is too big for a final year
project, you might as well find a couple of good ideas in Cython's list of
potential enhancements. Check the Wiki.

http://cython.org/

Stefan



More information about the Python-list mailing list