views:

760

answers:

3

Hello

I am interested in getting some Python code talking to some Ruby code on Windows, Linux and possibly other platforms. Specificlly I would like to access classes in Ruby from Python and call their methods, access their data, create new instances and so on.

An obvious way to do this is via something like XML-RPC or maybe CORBA but I would be interested in any other approaches.

What have other people done to get code from Python and Ruby communicating with one another, either locally on the same system or remotely accross a network?

Thanks in advance.

+3  A: 

Please be advised that I don't speak from personal experience here, but I imagine JRuby and Jython (The ruby and python implementations in the JVM) would be able to to easily talk to each other, as well as Java code. You may want to look into that.

James McMahon
This sounds interesting, does anyone have experience with this?
monkut
Yes, i like the idea of everything opperating in the same jvm and as such a 'native' bridge between them. interesting suggestion nemo, thanks.
QAZ
+4  A: 

Well, you could try named pipes or something similar but I really think that XML-RPC would be the most headache-free way.

Toni Ruža
I think your right, xml-rpc is probably my best option.
QAZ
+1  A: 

This isn't what your after, but worth a read: embed Python interpreter in Ruby: this code's pretty old

http://www.goto.info.waseda.ac.jp/~fukusima/ruby/python/doc/index.html

OR: why, rewriting bytecodes

http://github.com/why/unholy/tree/master

Gene T