Ruby is an up and coming language. Even if you do not actively develop in Ruby chances are that your programming language of choice has already been influenced by it.
Microsoft is obviously concerned about Ruby stealing some of their market share. As a result, they hired John Lam to work on the implementation of IronRuby which uses the new DLR (Dynamic Language Runtime). The DLR adds functionality such as a shared dynamic type system, a standard hosting model, and support to make it easy to generate fast dynamic code and fast symbol tables. With these additional features, it is much easier to build high-quality dynamic language implementations for .NET. Furthermore, these features enable dynamic languages built on the DLR to share libraries written in other dynamic languages or in CLR-based static languages. IronPython will also utilize the DLR.
With Ruby you can do more with less. The example below shows how you can easily manipulate arrays. If you are used to a traditional language like C++ then you will be intrigued by the fact that the array is mutable and you can use operators (+,-) to add an subtract items from the arrays.
1: # creating an array is easily done by using the square brack syntax 2: array.new candidates = ["John McCain", "Hillary Clinton", "Barrack Obama", "Ron Paul"]
3: eliminated = ["Hillary Clinton","Ron Paul"]
4: # the array is mutable so we can add more elements on the fly
5: eliminated += ["John McCain"]
7: # the operators (-,+) allow you to easily change the arrays
8: winner = (candidates - eliminated).to_s
9: puts "The winner of the election is " + winner
10: # ruby has a easy and compact syntax for iterating over collections.
11: # With ruby you can do more with less!
12
: puts
"\nThe following candidates did not win the election: "
13: ( candidates - winner.to_a ).each do | x |
14: puts " * " + x end