Hi Carl, Anto,

This is what I am going to play with for the next few weeks.

Idea:     "Allow PyPy-JVM to use Java classes from within Python code"   
OR  "pypy-jvm integration for ... "

Some hacking to do :-)
a) on the translation toolchain, especially on the Java backend to 
support interaction with Java classes. ( not sure what it really means )
b) on the PyPy interpreter to expose these features to the user.

Steps I should follow:
a) look at the implemented for PyPy-CLI  (look at /pypy/module/clr  and  
pypy/translator/cli/dotnet.py)
b) gain some knowledge of reflection in JVM and the bytecode, to use 
java classes.

Pinch me if I am wrong. And give me more pointers which would make my 
life easier.

- Regmee

Carl Friedrich Bolz wrote:
> Hi Amit,
>
> amit wrote:
>> I went across this page 
>> http://codespeak.net/pypy/dist/pypy/doc/project-ideas.html
>>
>> My project requires me to modify an existing compiler or interpreter, 
>> or write a program from scratch. I could not figure out how much time 
>> it would take to say write an interpreter for Aldor. If someone has 
>> some suggestion on any idea that I could put an effort into for 4 
>> weeks (that's when my project work is due) I would be very happy to 
>> learn more of pypy.
>>
>> I have fair amount of python coding experience.
>
> The answer, as usual, is "depends". Starting an interpreter for this 
> language from scratch is probably very hard if you are not re-using 
> code from existing implementations. Is there some sort of intermediate 
> code format that you can reuse? Can you reuse the parser and type 
> inferencing engine somehow (since you probably don't want to rewrite 
> that)?
>
> Another reason why Aldor might not be suited well (if I understand 
> things correctly) is that it is an extension language to a CAS system, 
> which means you would need to call back into the CAS at certain 
> points. This is probably quite some additional effort which is not 
> directly relevant to the real problem (writing an interpreter).
>
> If you are not dead-set on Aldor you could think about implementing 
> another language or about working on one of our existing interpreters 
> (or on the translation toolchain, which really is a compiler).
>
> An example of a project that would be useful for us and involves a bit 
> of compiler and a bit of interpreter hacking is the following: Allow 
> PyPy-JVM (the PyPy Python interpreter translated to the JVM) to use 
> Java classes from within Python code, similarly to what Jython 
> provides. This is implemented for PyPy-CLI already, so you could 
> roughly follow this implementation. It would need some hacking on the 
> translation toolchain, especially on the Java backend to support 
> interaction with Java classes. It needs a bit of knowledge of the JVM, 
> especially of reflection to dynamically use java classes. And finally 
> it needs some hacking on the interpreter to expose these features to 
> the user.
>
> It's probably a bit much for a four week project, but both Anto Cuni 
> (the author of the CLI backend and general PyPy contributor) and me 
> could mentor you a bit, if you feel like it.
>
> Anyway, that's just one idea, we can also think of others, if you tell 
> us a bit more about your interests.
>
> Cheers,
>
> Carl Friedrich
>

_______________________________________________
[email protected]
http://codespeak.net/mailman/listinfo/pypy-dev

Reply via email to