[IronPython] Running Ruby code from Python, which is running in Ruby

Tomas Matousek Tomas.Matousek at microsoft.com
Mon May 11 19:32:01 CEST 2009


"There are still some issues (running Python code in Ruby didn't seem to work)"

If you run into any issues let us know - ideally file a bug at http://ironruby.codeplex.com or http://ironpython.codeplex.com including a repro. We would like to make the language interop as smooth as possible.

Thanks,
Tomas

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Douglas S. Blank
Sent: Monday, May 11, 2009 10:06 AM
To: Discussion of IronPython
Subject: [IronPython] Running Ruby code from Python, which is running in Ruby

Perhaps you've seen this, but I ran across Tomáš Matoušek's blog this 
weekend http://blog.tomasm.net/category/ironruby/ where he describes a 
little interactive Ruby shell that works something like:

$ irb.exe repl.rb
rb> class C
rb|   def say_hello caller
rb|     puts "#{caller} says hello to Ruby"
rb|   end
rb| end
=> nil

Now, he switches languages on the fly:

rb> #py

Now, from Python he imports and runs the Ruby class in Python:

py> import C
py> c = C()
py> c.say_hello("Python")
Python says hello to Ruby

I thought I'd try this in the educational DLR editor/shell that we're 
developing in C# (at http://pyjamaproject.org/Pyjama ) and it works! 
There are still some issues (running Python code in Ruby didn't seem to 
work), and you need the latest drop of the DLR (I used 23458):

http://www.codeplex.com/dlr/SourceControl/ListDownloadableCommits.aspx

which isn't stable. But, the proof of concept is fantastic to see after 
all of the hard work. Best of all, the same DLLs allow all this to work 
on Linux and Mac OSX too, thanks to Mono.

This means that you can write and compile a library *once* in whatever 
language you want, use it from other languages, on whatever operating 
system you want. Wow.

Thank you to all those that are making this possible! (And more on our 
DLR IDE soon...)

-Doug

-- 
Douglas S. Blank
Director, Institute for Personal Robots in Education (IPRE)
http://www.roboteducation.org
Chair, and Associate Professor, Computer Science, Bryn Mawr College
http://cs.brynmawr.edu/~dblank  (610)526-6501
_______________________________________________
Users mailing list
Users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com




More information about the Ironpython-users mailing list