« IronRuby plans revealed on .NET Rocks | Main | OSCON Wrap-up »

July 23, 2007

A first look at IronRuby

IronRuby code gen

We've been working very hard over the past couple of months to get our first source code release ready. I'm happy to announce today the first drop of the IronRuby source code. IronRuby is licensed under very liberal terms as set out by the Microsoft Permissive License.

We're also happy to announce that we will be accepting source code contributions into the IronRuby libraries. Right now we have a lot of logistical work that we still need to do, but we fully intend on getting IronRuby onto Rubyforge by the end of August.

Some of you may be wondering why we are only accepting contributions into the libraries and not the entire compiler. It's because IronRuby is built on top of the Dynamic Language Runtime (DLR), and the public interfaces to the DLR are not complete at this time. Since the DLR will ship as part of the CLR in the future, we cannot accept contributions into the IronRuby compiler, at least initially. However, once the DLR matures and reaches 1.0 status with fully supported public interfaces, we will fully open up all parts of the IronRuby project for external contributions.

To start playing with this release, you'll need to build IronRuby. This release of IronRuby requires the .NET Framework 2.0 Redistributable. Just unzip the source code file, and run the build.cmd batch file to create a release-mode build of IronRuby.

You can kick the tires by typing some code interactively using our simple REPL console application. You'll find it at \bin\release\rbx.exe. You should add \bin\release to your path to make your life easier.

Next you should look at the unit tests under \tests\ruby\builtins. This will give you an idea of what works and what doesn't work in IronRuby. We've put most of our effort into Array and String; any other support that's in the libraries was put in there to support building Array and String features.

We have .NET interop working out of the box; you can import .NET libraries into your Ruby programs via require:


require 'mscorlib'
require 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

Notice how you need to use the fully-qualified assembly name in require.

We don't have include working yet at top-level scope, so you'll need to either use fully-qualified type names or assign them to constants:


Window = System::Windows::Forms::Window

We also have pretty good performance in this release. We use a DLR feature called Dynamic Sites, which is our implementation of adaptive call-site method caching. Other than using Dynamic Sites, we have not done any other specific performance tuning for this release.

In micro-benchmarks which measure method call performance, we are significantly faster than Ruby 1.8.6. In micro-benchmarks which measure library performance, we are on par with Ruby 1.8.6; we expect to see performance improvements in these benchmarks in the future. In micro-benchmarks that involve raising exceptions, we are slower than Ruby 1.8.6; but if control flow on your program's critical path involves raising exceptions you may want to rethink your design :)

We're really interested in hearing what you have to say about this release. I'm at OSCON all week, so feel free to come up and say hello if you're attending. My IronRuby talk is this Thursday at 5:20pm, and I'll be busy cooking up a fun demo for that talk between now and then. If you're not at OSCON, feel free to send mail to jflam at the big software company in Redmond.

Last but most important, I'd like to thank the members of the IronRuby team: Tomas Matousek, and Haibo Luo for their hard work in getting this release out the door. Great job, guys!

Update

Some additional posts worth reading:

Scott Guthrie, who has a nice sample on using IronRuby with WPF

Jason Zander, on working with the open source community

Miguel de Icaza, for an outside perspective of our changes as a company

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d834fc885d53ef00e008ddb2698834

Listed below are links to weblogs that reference A first look at IronRuby:

Comments

Hello John,

Congratulations!

I have been waiting for this since ages. I am happy to my gift 3 days earlier than expected.

Where can i see all those white papers related to IronRuby, Have you managed to release it or still under preparation...?

Great to see IronRuby on the First day of Oscon 2007.

I am sure IronRuby will be the most hot topic discussion at Oscon.

Cheers Again.

Awesome. Nice work!

And nice meeting you yesterday, too.

This is awesome news, congrats!

Btw, what about Visual Studio integration? I have some experience and I'd sure contribute into IronRuby VS integration project.

Hi John,

Nice work but what's the deal with all the environment variables in the batch files - like %ROWAN_BIN% and %MERLIN_ROOT% ?

My system doesn't have them setup...are these internal variables? I notice iron python uses the same ones.

The docs is somewhat different :)

Will play more this evening.

Ben

Just to comment on Oleg Tkachenko's post, having a similar F# interactive console in VS for IronRuby would be great! Does IronPython have anything like this?

Great stuff John, glad to see things are moving along smoothly.

Congrats on the release, John! Very nice. I guess I'll have to play with it in my Windows Parallels.

One detail, you might want to remember that Rubinius uses rbx as the command name, and that your simple IRB goes by the same name will cause clashes at some point.

Hope to see you this week!

Thanks, everyone!

@{Oleg,Ben): I would love to see an F# interactive console in VS as well. We could definitely use the help to implement that feature (you can see that we don't exactly have a big team :)) IronPython does not currently have this feature. I just had lunch on Friday (accidentally as it turns out) with a dev on the F# team at MSR. I'll ping him to see if he'd like to help out on that integration as well.

@Ben: Sorry about the environment variables. We extracted this source code from the much larger project that we have that builds all four of the languages on the DLR (IronRuby, IronPython, VB, and JS). Our build packaging script doesn't grovel through batch files to do the right thing (yet). So for now the only batch file that is guaranteed to work is build.cmd in the root - please ignore any other ones that might be sprinkled throughout the sources until we get our build script working correctly.

@Ola:

I had no idea that Rubinius uses rbx - talk about a small world :)

Hi John, just wondering why you don't release it on Codeplex (like IronPython) instead of RubyForge?

@Isaac:

I (and I'll use I here since I fully take responsibility for this decision if it doesn't work) felt that more folks contributing to open source projects were comfortable with Subversion than with TFS. I wanted to make it as easy as possible for folks to contribute, so Rubyforge was the natural choice here.

Congrats Jon! Wow! Accepting source code contributions? What'd you do? Tie up the Microsoft lawyers in the basement somewhere? ;)

Wow, I am super surprised and very, very happy! Not only did you drop the bits three days early, but you gave us SVN (through RubyForge) and a timeline for accepting external contributions! Both moves are *huge* for the Ruby community. Well done!

Great things going john,

I am wondering if at all, i can see few working examples just like IronPython in asp.net futures section.

Posting few working examples would be great.

Just my opinion.

Good news! I'm looking forward to see how we can add Visual Studio support IronRuby into Ruby In Steel ;-)

best wishes
Huw

I had trouble building it until I tweaked Build.cmd a bit and added a Platform parameter:

C:\Windows\Microsoft.NET\Framework\v2.0.50727\msbuild.exe /p:Configuration=Release /p:Platform="Any CPU" /t:Rebuild IronRuby.sln

After that, all was well. John, congrats, and I'm looking forward to having this on RubyForge, good times!

I've built IronRuby from the source on Mono, and uploaded Build Kit for the beneift of anyone who want to try.

http://sparcs.kaist.ac.kr/~tinuviel/download/IronRuby/

"felt that more folks contributing to open source projects were comfortable with Subversion than with TFS"

I can see why you went with RubyForge, but Codeplex now offers the SvnBridge so you can use SVN clients, but under the covers it is infact TFS.

http://www.codeplex.com/SvnBridge

Might be something worth keeping in mind.

@BenHall: yes the svn bridge is a nice and welcome addition to codeplex for SVN users...but my understanding is SvnBridge will be a windows-only implementation? i could be wrong.

Ahh sorry you are right, my understanding was it was server side. Bit limiting it being windows only....

Miguel de Icaza just posted on his blog

"This is a probably a good time to point to Joel Reed's work. He wrote an open source client for accessing TFS systems (CodePlex or your own company's server) from Unix systems running Mono. (http://code.google.com/p/tf4mono/)"

C o n g r a t u l a t i o n s !

Although we have tf4mono, my vote is still to go with with a Subversion deployment, it means that people can start working on this without requiring extra software to be installed (And Subversion is pretty much part of the Unix fabric at this point).

Miguel.

@WebReservoir:

We're still quite a ways from ASP.NET. There are a lot of implementation details to sort out, particularly around how we deal with isolating concurrently executing pages from each other.

@Seo:

Thanks for the quick turnaround! We'll get rid of the redundant assert in our code as well :)

Be sure to remove duplicate MemberAssignmentExpression.cs as well.

Congratulations, John (and team)! The Ruby community is going to look back on this years from now as a very important and positive milestone.

Congrats, John! I'm anxious to play with the source.

I've downloaded and compiled the drops without any issue, and gave the interpreter a try; everything went smoothly!

Congratulations!

Great Stuff! Does it work with wpf? if so, any code sample you could point to? Thank You.

Great! Congratulations to John and all the team behind IronRuby and the DLR, now I'm really impatient to try it :) BTW I think you deserve extra-kudos for the decision to host the source code on Rubyforge.

@krishna: See Scott Guthrie's sample (link in the updated blog entry) for a WPF sample. Scott Hanselman has also created one: http://www.hanselman.com/blog/WPFSampleInIronRubyTalkingViaCToWesabe.aspx

Hello John,

Is it possible to call a IronRuby class in c#? or it works for IronRuby to call c# object only?

thank you~

Cool !!!
Can't wait to try.
Thank you !

Cool !!!
Can't wait to try.
Thank you !

Great milestone u guys got to... the best of lucks on the stages to come!

Nice and cool!

One thing: does it work with .NET 3.0?

it's cool!!
wow~~!!
i don't believe,
i think ii's great and creat news!!

another thing : with .net 2.0? 3.0?

@Jason: yes you can call a Ruby object from C# - either via an event that has a Ruby block bound to it, or via a call to a CLR interface that is implemented by a Ruby object.

@{Sadeq|cherryeyes}: it requires .NET 2.0, but will work with .NET 3.0 as well.

Great Job, congrats!

@cherryeyes: Could You please give an example of how to call a Ruby object from C#?
Thx in advance!

Hey,
I wanna say great job on this I like the direction its heading but I have one question. I ran into a snag trying to use the Time.now command from ruby. I tried to require Time but had no luck with that. Has anyone else gotten things other then hello world and interaction with WPF to work with this yet? I would really like to explore it more and am really excited for this project.

Keep up the good work!
-CH

18 months ago, I was a ruby newbie, doing Rails at a major search engine.

David Thomas (of pickaxe book fame) came and did an all day class on Ruby for the group.

When it was time for Q&A, I asked a number of questions that really ruffled his feathers.

My favorite one was "Dave, do you ever see Ruby running under .NET?"

He fumed, got all loud and screamed at me that this day would never come cause Ruby was "too complex" for .NET


So congrats John and team for letting me have the last laugh on this one.

congrats first!great job

however,some issues here
although it's a pre-alpha version,i found that even some basic arithmetic operations are missed

for example,1/2.0 gives 0;1.0/2.0 will result in an exception

power,like 2**3,is also not implemented yet?

The same happens when i try some code with Bignum class

Hope to see promoted releases soon!

@chengmeng: Those basic arithmetic operations are trivial to implement. In the spirit of open source, I fixed those myself. See http://fepy.blogspot.com/2007/07/teaching-ironruby-math-tricks.htm for details.

Bah the above URL has the last letter missing. Here it is again: http://fepy.blogspot.com/2007/07/teaching-ironruby-math-tricks.html

Why not release under the Ruby license?

Any win form examples for IronRuby.

Last December we decided to support IronPython for our functional web testing tool InCisif.net.

I like to give a shot at IronRuby ?

Thanks.

@Matt: The Ruby license is a special-case license with unusual provisions

@Ftorres: These will be coming soon (my talk this afternoon does some Winforms).

Congrats! John,

I'm hearing about IronRuby a lot. So finally it's started to come out. OK

I've some knowledge of Ruby. Could you please point some links? I want to start learn and work on it :)

Kind Regards

John,

What's the chance of us ever seeing IronScheme? It would be good to have something to take over from where Common Larceny leaves off. What do you think: in this life or the next? ;-)

Don't get me wrong Python and Ruby are mucho cool but when I want to get my functional / language-compiler designer grove on then Scheme is what I really want. WPF apps written in Scheme... you know it makes sense :-)

Kind regards,

tom

I've downloaded and compiled. On my box %frameworkdir% and %frameworkversion% variables are not set. I just used SDK console
msbuild.exe /p:Configuration=Release /t:Rebuild IronRuby.sln

Tested apps with winforms.
Its awesome.

@Sriharsha:

I'll fix the build script to do the right thing in the next release (my fault for not testing on XP and only the Vista dogfood build on my desktop).

@Tom:

I really hope *someone* builds this ... calling Joe Duffy?

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Photos

  • www.flickr.com
    This is a Flickr badge showing public photos from John Lam. Make your own badge here.

May 2009

Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Blog powered by TypePad