Discussion:
Convert python script in ruby
gp
2003-02-28 11:23:11 UTC
Permalink
Hi,

Is there any software to convert python script in ruby?

Thanks!

gp-
Albert Chou
2003-03-01 01:46:48 UTC
Permalink
I've been working on a Ruby script that does a great deal of the
translation from Python to Ruby, but it's by no means a complete
solution, and I don't know whether it ever will be.

Al


-----Original Message-----
From: gp [mailto:***@NOSPAM.le.isac.cnr.it]
Sent: Friday, February 28, 2003 3:23 AM
To: ruby-talk ML
Subject: Convert python script in ruby

Hi,

Is there any software to convert python script in ruby?

Thanks!

gp-
Robert Feldt
2003-03-01 07:00:11 UTC
Permalink
Post by Albert Chou
I've been working on a Ruby script that does a great deal of the
translation from Python to Ruby, but it's by no means a complete
solution, and I don't know whether it ever will be.
Interesting, do you have a Python parser in there?

I have the starts of a python-to-ruby translator in Python (don't throw
rotten tomatoes please, I wanted to check it out). Its very simple to do
that in Python since they export an API to the internal parser so you get
a full Python parser with AST representation "for free" (hint, hint matz
and I know you have it in the TODO).

I think our community would really benefit from such a tool; when we find
some extension they have that we want the tool would give a head start in
translating.

If your tool is close to complete I don't want to put more effort into
mine. It was really just a hack I did when checking out Python. Is there a
way we can join forces and get something more complete faster?

Regards,

Robert Feldt
Albert Chou
2003-03-02 21:17:10 UTC
Permalink
No, mine is a purely syntactic translator based on regular expressions,
with some domain-specific ones that know how to convert from particular
Python package usages (including translating "import" to "require"
statements). Nothing as interesting as yours, but it does the tedious
majority of the translation I needed for seeing if I could port FIT from
Python to Ruby (easier than Java to Ruby, I felt).

I would be happy to share my script, though it's not on the machine I'm
emailing from this moment, so please remind me to send it.


Al


-----Original Message-----
From: Robert Feldt
Sent: Fri 2/28/2003 11:00 PM
To: ruby-talk ML
Subject: Re: Convert python script in ruby
Post by Albert Chou
I've been working on a Ruby script that does a great deal of the
translation from Python to Ruby, but it's by no means a complete
solution, and I don't know whether it ever will be.
Interesting, do you have a Python parser in there?

I have the starts of a python-to-ruby translator in Python (don't throw
rotten tomatoes please, I wanted to check it out). Its very simple to do
that in Python since they export an API to the internal parser so you
get
a full Python parser with AST representation "for free" (hint, hint matz
and I know you have it in the TODO).

I think our community would really benefit from such a tool; when we
find
some extension they have that we want the tool would give a head start
in
translating.

If your tool is close to complete I don't want to put more effort into
mine. It was really just a hack I did when checking out Python. Is there
a
way we can join forces and get something more complete faster?

Regards,

Robert Feldt
Mauricio Fernández
2003-10-09 17:34:04 UTC
Permalink
Post by gp
Hi,
Is there any software to convert python script in ruby?
If you stay here for a while matz will program your brain;
up to you to decide if that's 'software' :-)

Seriously, there's not such a thing AFAIK.
--
_ _
| |__ __ _| |_ ___ _ __ ___ __ _ _ __
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

Try to remove the color-problem by restarting your computer several times.
-- Microsoft-Internet Explorer README.TXT
Albert Chou
2003-10-09 21:59:42 UTC
Permalink
I have a Ruby script that translates a lot of Python's syntax into Ruby,
but beyond what it does, you still have to manually check and modify the
results into true Ruby. I found it very helpful as I tried to port FIT
from Python to Ruby (a project I never finished, so I'm glad Dave did
it).

Al


-----Original Message-----
From: Mauricio Fernández [mailto:***@yahoo.com]
Sent: Thursday, October 09, 2003 10:34 AM
To: ruby-talk ML
Subject: Re: Convert python script in ruby
Post by gp
Hi,
Is there any software to convert python script in ruby?
If you stay here for a while matz will program your brain;
up to you to decide if that's 'software' :-)

Seriously, there's not such a thing AFAIK.
--
_ _
| |__ __ _| |_ ___ _ __ ___ __ _ _ __
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

Try to remove the color-problem by restarting your computer several
times.
-- Microsoft-Internet Explorer README.TXT
Josef 'Jupp' SCHUGT
2003-10-10 00:10:32 UTC
Permalink
Hi!
Post by gp
Is there any software to convert python script in ruby?
There is an awful lot of them: vim, Xemacs, Notepad, Textpad, ...

Please take notice of signature! / Bitte Signature beachten!

Josef 'Jupp' Schugt
--
db Wenn sie mir ohne meine Einwilligung geschickt wurde, db
dpqb wird eine E-Mail > 100 kB ungelesen entsorgt dpqb
dp::qb If you send me an e-mail > 100 kB without my dp::qb
dp::::qb consent it will be silently discarded dp::::qb
Loading...