Aureliano Calvo schrieb:
> Hi all!
> I'm thinking about implementing a ruby to python translator (this is a
> program that takes a ruby program and generates its equivalent program
> in python). In order to get started, I would like to know if there is
> a ruby grammar implemented in python or with another tool.
> 
> The final idea for the project would be to run ruby code on the OLPC.
> 
> Can you give me any pointers?

I'm translating Ruby to Javascript and use ParseTree for that. Python is a 
little less dynamic than Ruby, so for example AFAIK Python doesn't execute 
module-level code when it is loaded as Ruby does. That means that you can't 
simply convert Ruby to Python code 1:1. What I am doing with RubyJS (my Ruby to 
Javascript compiler) is to first evaluate the Ruby code (all meta-programming 
stuff is going on here) and then compile each class to Javascript. This is very 
powerful.

It should be easier to compile Ruby to Python than it is for compiling Ruby to 
Javascript. But I'd be more interested in compiling Python to Ruby, which should 
be even easier.

Regards,

   Michael