A first look at IronRuby
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

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.
Posted by: SoftMind | July 23, 2007 at 03:20 AM
Awesome. Nice work!
And nice meeting you yesterday, too.
Posted by: Adam | July 23, 2007 at 04:19 AM
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.
Posted by: Oleg Tkachenko | July 23, 2007 at 05:23 AM
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
Posted by: Ben Hall | July 23, 2007 at 06:10 AM
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?
Posted by: Ben Hall | July 23, 2007 at 06:11 AM
Great stuff John, glad to see things are moving along smoothly.
Posted by: Nick Parker | July 23, 2007 at 06:22 AM
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!
Posted by: Ola Bini | July 23, 2007 at 06:22 AM
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.
Posted by: John Lam | July 23, 2007 at 06:29 AM
@Ola:
I had no idea that Rubinius uses rbx - talk about a small world :)
Posted by: John Lam | July 23, 2007 at 06:30 AM
Hi John, just wondering why you don't release it on Codeplex (like IronPython) instead of RubyForge?
Posted by: Isaac | July 23, 2007 at 07:22 AM
@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.
Posted by: John Lam | July 23, 2007 at 07:38 AM
Congrats Jon! Wow! Accepting source code contributions? What'd you do? Tie up the Microsoft lawyers in the basement somewhere? ;)
Posted by: Haacked | July 23, 2007 at 08:04 AM
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!
Posted by: Mike Moore | July 23, 2007 at 08:26 AM
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.
Posted by: WebReservoir | July 23, 2007 at 08:34 AM
Good news! I'm looking forward to see how we can add Visual Studio support IronRuby into Ruby In Steel ;-)
best wishes
Huw
Posted by: Huw Collingbourne | July 23, 2007 at 09:07 AM
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!
Posted by: tomcopeland | July 23, 2007 at 09:20 AM
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/
Posted by: Seo Sanghyeon | July 23, 2007 at 09:38 AM
"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.
Posted by: Ben Hall | July 23, 2007 at 10:30 AM
@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.
Posted by: timheuer | July 23, 2007 at 10:39 AM
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/)"
Posted by: Ben Hall | July 23, 2007 at 10:54 AM
C o n g r a t u l a t i o n s !
Posted by: Bil Kleb | July 23, 2007 at 11:00 AM
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.
Posted by: Miguel de Icaza | July 23, 2007 at 11:14 AM
@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 :)
Posted by: John Lam | July 23, 2007 at 11:58 AM
Be sure to remove duplicate MemberAssignmentExpression.cs as well.
Posted by: Seo Sanghyeon | July 23, 2007 at 12:01 PM
Congratulations, John (and team)! The Ruby community is going to look back on this years from now as a very important and positive milestone.
Posted by: Chad Fowler | July 23, 2007 at 12:18 PM
Congrats, John! I'm anxious to play with the source.
Posted by: Javier Lozano | July 23, 2007 at 12:20 PM
I've downloaded and compiled the drops without any issue, and gave the interpreter a try; everything went smoothly!
Congratulations!
Posted by: Thibaut Barrère | July 23, 2007 at 12:48 PM
Great Stuff! Does it work with wpf? if so, any code sample you could point to? Thank You.
Posted by: krishna | July 23, 2007 at 12:50 PM
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.
Posted by: NRK | July 23, 2007 at 01:06 PM
@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
Posted by: John Lam | July 23, 2007 at 06:03 PM
Hello John,
Is it possible to call a IronRuby class in c#? or it works for IronRuby to call c# object only?
thank you~
Posted by: Jason | July 23, 2007 at 07:29 PM
Cool !!!
Can't wait to try.
Thank you !
Posted by: Jirasak | July 23, 2007 at 09:21 PM
Cool !!!
Can't wait to try.
Thank you !
Posted by: Jirasak | July 23, 2007 at 09:21 PM
Great milestone u guys got to... the best of lucks on the stages to come!
Posted by: Samiq | July 23, 2007 at 10:46 PM
Nice and cool!
One thing: does it work with .NET 3.0?
Posted by: Sadeq | July 23, 2007 at 10:49 PM
it's cool!!
wow~~!!
i don't believe,
i think ii's great and creat news!!
another thing : with .net 2.0? 3.0?
Posted by: cherryeyes | July 24, 2007 at 10:59 PM
@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.
Posted by: John Lam | July 25, 2007 at 02:18 AM
Great Job, congrats!
@cherryeyes: Could You please give an example of how to call a Ruby object from C#?
Thx in advance!
Posted by: Chriss | July 25, 2007 at 07:39 AM
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
Posted by: johnsonch | July 25, 2007 at 12:55 PM
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.
Posted by: Rodney Reid | July 25, 2007 at 02:29 PM
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!
Posted by: chengmeng | July 26, 2007 at 07:44 AM
@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.
Posted by: Seo Sanghyeon | July 26, 2007 at 08:40 AM
Bah the above URL has the last letter missing. Here it is again: http://fepy.blogspot.com/2007/07/teaching-ironruby-math-tricks.html
Posted by: Seo Sanghyeon | July 26, 2007 at 08:41 AM
Why not release under the Ruby license?
Posted by: Matt Lee | July 26, 2007 at 02:06 PM
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.
Posted by: Ftorres | July 26, 2007 at 03:59 PM
@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).
Posted by: John Lam | July 26, 2007 at 04:51 PM
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
Posted by: Ashok Guduru | July 26, 2007 at 10:21 PM
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
Posted by: Tom Kirby-Green | July 26, 2007 at 10:48 PM
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.
Posted by: Sriharsha Vardhan | July 27, 2007 at 05:48 AM
@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?
Posted by: John Lam | July 27, 2007 at 08:07 AM