tiny python

François Pinard pinard at iro.umontreal.ca
Tue Dec 7 14:29:51 EST 1999


Noel Burton-Krahn <noel at burton-krahn.com> writes:

> I would like to make the smallest python interpreter possible.

Could we turn this into a contest?  It might be instructive.  A bit like with
SIOD for Scheme, say.  By the way, would it be workable to implement Python
in Scheme?  Who knows, this might buy us a compact notation for algorithms.
There is little chance to see a winning solution in COBOL, say. :-)

The precise rules for such a context might rather difficult to establish,
however.  If we need a big interpreter in some other language to run
a Python interpreter in that language, we are not reaching the goal.
We should consider the overall size of the thing.  And more importantly,
how do we define `Python'?  We would also need a validation suite just to
establish what Python means.

> Is it possible to build a python interpreter which just reads byte code?

To spare lexing/scanning sources?  Contest rules should tell what input
format is acceptable.  It could be real sources, `.pyc' as produced by C
Python, or maybe some other representation (like a Scheme-readable tree),
but the representation could be chosen to convey part of the interpreter:
I'm not sure where cheating would begin.

Just thinking loud.  Do not read this message :-)  [Only now he says it?]

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard






More information about the Python-list mailing list