Re: Python as an intermediate lang for compiler/interpreter development ?

"Mark C. Chu-Carroll" <mcc@watson.ibm.com>
13 Jun 1997 21:59:20 -0400

          From comp.compilers

Related articles
Python as an intermediate lang for compiler/interpreter development ? gilliam@im.lcs.mit.edu (1997-06-10)
Re: Python as an intermediate lang for compiler/interpreter developmen mcc@watson.ibm.com (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)
| List of all articles for this month |

From: "Mark C. Chu-Carroll" <mcc@watson.ibm.com>
Newsgroups: comp.lang.python,comp.compilers
Date: 13 Jun 1997 21:59:20 -0400
Organization: IBM T. J. Watson Research Center
References: 97-06-027
Keywords: translator, OOP

  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.
>Thanks.


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.


          -Mark


--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.