|Python as an intermediate lang for compiler/interpreter development ? email@example.com (1997-06-10)|
|Re: Python as an intermediate lang for compiler/interpreter developmen firstname.lastname@example.org (Mark C. Chu-Carroll) (1997-06-13)|
|Re: Python as an intermediate lang for compiler/interpreter developmen lkrupp@netONE.com (Louis Krupp) (1997-06-20)|
|From:||"Mark C. Chu-Carroll" <email@example.com>|
|Date:||13 Jun 1997 21:59:20 -0400|
|Organization:||IBM T. J. Watson Research Center|
Harris Gilliam wrote...
>A while back I asked this question... got no replies or followup
>posts. If this is some sort of "sin" in the Python community please
>tell me :-) Anyway... I was interested in seeing if Python would make
>a good intermediate language for developing an interpreter/compiler
>for a language that closely resembles C and C++. If anyone has done
>this or something similar I'd be interested in your experiences.
My inclination is to say no.
Intermediate representations and high level scripting languages have
very different requirements. Python makes a great scripting language,
but its design is almost perfectly opposed to what you'd want for a
good compiler intermediate representation.
Intermediate representations are designed to be easy to generate, easy
to analyze, easy to transform, and easy to translate into object
code.Python completely fails on the second and fourth: the very same
dynamic properties that make it a good scripting language make it
extremely difficult to analyze, or to generate object code for.
Python would probably make a decent language to implement a compiler
in - but not a good language to use as an intermediate form.
Return to the
Search the comp.compilers archives again.