compiling to python byte codes

Maurice LING mauriceling at acm.org
Fri Sep 3 05:38:37 CEST 2004


Jeremy Bowers wrote:
> 
> Hmmm, could you post an example of this assembly-like code? It might be
> easiest to implement a Python interpreter directly; if the assembly-like
> code is simple enough it isn't even worth a true parser.

What do you mean by implementing a Python interpreter directly? Sorry, I 
am unable to provide an example of this assembly-like code. This is 
currently still unpublished work, so I'm not able to disclose much, 
especially in a public forum.

> Without knowing about your code, I can't be sure, but I would be surprised
> if MA is similar enough to Python to make it worth running MA on the
> Python machine directly. 

Do you think that there is very slight chance that it is worthwhile 
converting MA directly to python bytecodes? This is how I read it. 
Please tell me if I've misunderstood you.

> 
> Assembly language is right up there with LISP (without macros) in terms of
> ease of parsing, if no opcode ever crosses multiple lines. 

Some parts of MA is still undergoing development and cleaning up but I 
certainly do not see why any opcode should cross multiple lines. As far 
as I can see, 70% of the opcodes are able to be represented by multiple 
lines of python codes. I've not thought hard enough on this yet.

All I can say is that MA looks similar to any assembly is structure, 
with directives.

Sorry that I am not able to disclose much, but hope to get some opinions 
based on what I can say.

Thank you,
Maurice



More information about the Python-list mailing list