Ruby, .NET and IronRuby for beginners

I’ve been playing with the .NET framework for a while now. I still love it. I also love touching other environments. Ruby is one of them.  It’s a powerful and flexible programming language that you can use for web/internet development. It’s object-oriented and dynamically typed. You therefore don’t need to specify the type of an object before using it. It has a focus on elegant syntax, simplicity and productivity. It is natural to read and easy to write.

Matz

Yukihiro “Matz” Matsumoto

Ruby has been created by “Matz”, fellow at the Rakuten Institute of Technology and now member of Heroku and Chief Architect, Ruby at Heroku. Matz has created a beautiful and elegant language that has steadily grown a passionate following, becoming wildly popular in recent years, partially thanks to David Heinemeier Hansson’s Ruby on Rails web framework.

Ruby

Click image to learn about Ruby

IronRuby is an implementation of the Ruby language on the .NET platform. It allows you to interact with .NET languages like C# and VB.NET.

The following code does a simple addition.

Ruby

The above code uses “.class” to output objects classes, for testing purposes.
IronRuby will use the Dynamic Language Runtime to interop with .NET code. The DLR is accessible from anywhere within the .NET ecosystem.

You can start playing with IronRuby on the windows platform by downloading it here.

Once that’s done, you can just access the interactive environment by using the ir command which will automatically be added to your PATHs. I usually open it inside GitBash or any another command line.

IronRuby

On the MacOS ecosystem, you can just access the Ruby interpretor by opening the terminal and typing irb. The following picture shows the Ruby Interpreter on a MacOS environment. I’ve just executing some commands on the fly.

Ruby Interpreter MAC

IronRuby is widely used in the community as you can see with the stats below which describe the number of downloads done so far, as of November 2013.

downloads

Take the time to discover the Ruby world if you haven’t yet. You might find some very very interesting paradigms that will help you have a different and better view on your current language/platform of choice.

Links
Ruby in Twenty minutes
IronRuby
Ruby on CodeAcademy
Try Ruby in 15 minutes in your browser
Ruby documentation

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s