mtnwestruby: RubyCLR and Ruby.NET by John Lam

mtnwestruby: RubyCLR and Ruby.NET by John Lam
17 March 2007

John works for Microsoft. Before coming to Microsoft, he built the bridge for running Ruby on the CLR (common language runtime).

Why would anyone want to run Ruby on someone else’s virtual machine? To answer
that, we look at the overlap between what we want to do and what we actually
do at work. It would be nice to maximize that overlap. Many of us want to use
dynamic languages, by many of us have to use .NET or Java. Running dynamic
languages on the one of these VMs helps maximize the overlap.

The interop layer for Python is going to be fundamentally different than that
for Ruby so that when you write a Python program using .NET libraries, it still
feels like Python code, and when you write Ruby code, using .NET libraries, it
still feels like writing Ruby code.

Lutz is an MS employee that worked on Intentional Programming, which never went
anywhere at MS. He created an editor that would parse the AST (abstract syntax
tree) and display it in different ways. This idea lives on in the .NET
Reflector
, which will decompile .NET assemblies into IL, Visual Basic, C#,
Delphi, etc. It’s interesting to use Iron Python to compile code, and use the
.NET Reflector to look at the IL.

Dynamic methods are an interesting feature of the CLR in version 2.0. If they’re not going to be used, they get garbage collected. Before 2.0, once you load code, it stays loaded for the lifetime of the VM.

Interesting: The CLR supports polymorphic methods based on the return type, not jus the arguments. This isn’t a feature that C# supports.

The Ruby to .NET interop is extremely fast — millions of operations per
second.

John used Vim on Windows when he edited code.

On April 30th at the MS mixed conference, we will see the interesting things
that John Lam has been working on since he joined Microsoft, which he can’t
talk about right now. However, the really interesting conference will be Microsoft PDC because the technology will be more mature.

Q: Can you run Rails on the Ruby CLR?
A: No idea.

Q: Can I run Ruby.NET on mono or on my PowerPC?
A: There’s nothing that would preclude it from running on Mono, but Microsoft is not working on it.