[pypy-dev] CLI code generation

Antonio Cuni anto.cuni at gmail.com
Mon Mar 20 21:33:59 CET 2006

Hi Carl, hi Holger, hi all

Carl Friedrich Bolz wrote:

> First of all: would you like to have your code live in the "official" pypy-dist directory (Holger proposed using your user directory)? If yes that would mean that you had to agree to license your code under the MIT License (and to promise to follow the coding-guide and to write tests :-). That would mean that much more people would see what you are doing and could provide you with pointers about possible improvements. The most appropriate place for a cli backend would probably be pypy-dist/translator/cli

Yes, I like: the license is not a problem, I'm already following the 
coding-guide and I've just begun writing tests... :-)

About the directory, at the moment I'm writing my code just in 
pypy-dist/translator/cli, so I wouldn't need even to rearrange my imports.

> Will the .NET backend use the ootypesystem (which is what gensqueak uses) or the lltypesystem (which is what genllvm, genc and genjavascript uses)? I guess for C# the former would make more sense, but I have no clue how low-level IL is (I don't really have any clue about .NET at all :-).

I try to respond here to this question and to the other ones that are 
scattered in many messages of the thread.

Although the IL is an assembler language it is fairly a high level one: 
it can contains class definitions with field definitions, instance 
methods, static methods and so on, so I decided to adopt the 
ootypesystem: I hope to be able to translate rpython classes directly 
into CLI classes, thus allowing those to interoperate.

I have not yet studied the ootypesystem in details, so by now I can't 
say if it is tailored for CLI object model: if it's not I think the best 
thing is to extend the ootypesystem to introduce additional features, if 
it's not a problem; this should simplify the writing of future backends 
with object models similar to the CLI's one, such as Java.

Since I decided to use the ootypesystem I started from gensqueak, but 
now the code looks very different, because of smalltalk and CLI are two 
very different targets; the most interesting thing I borrowed from 
gensqueak (and genjs) is the test-model, with a class that wraps the 
compiled executable and behave like a normal python function, thus 
simplifying the testing; by now it only supports integer arguments, but 
it's not a problem since the generator can generate only integer 
operations :-).

I hope I've answered to all pending questions...

ciao Anto

More information about the Pypy-dev mailing list