[Mono-list] MonoPython?

David Dawkins david@dawkins.st
Fri, 04 Jan 2002 10:54:56 +0000

Guy wrote:
>I'll preface my comments by saying up front and clearly, I dont write
>compilers so it easy for me to make braod sweeping statements that are
>possibly completely off base.
>I was somewhat confused that ActiveState had had so many problems with
>Python.NET when Jython had been so successful, and then I read this is 
>white paper on the matter...
>The Python for .NET compiler is written using CPython.  It compiles Python
>source code, and uses the .NET Reflection::Emit library to generate a .NET
>assembly.  The  COM Interoperability features of .NET are used to access 
>Reflection::Emit library.
>Can this be regarded as a serious attempt to produce a Python.NET

What's wrong with it?  I would probably adopt a similar approach.
My own thoughts have been to use "jay" for the Python grammar
and obtain a parse tree of the Python code to be compiled.
(All in C# btw). Walk the parse tree and use System.Reflection.Emit
to create the byte code.

I think that the real problems are to do with mapping the
semantics of Python to .NET; this I can't yet comment
on, I haven't researched it enough.  I was wondering about
doing my research by hacking MonoPython and seeing exactly
why it won't work :-)


Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.