In a Guest Blog entry, SapphireSteel Software’s Huw Collingbourne writes about Ruby for TheServerSide Interoperability blog. The Ruby programming bandwagon is picking up speed and both Sun and Microsoft have jumped onboard, he says. In a way, Ruby embodies many of the features that made Visual Basic so successful. It is not so much what Ruby does today that is causing all the excitement - but, rather, what it might do some time soon.
By Huw Collingbourne, Sapphire Steel Software
The Ruby programming bandwagon is picking up speed and two of the biggest developer companies in the business - Sun and Microsoft - have already jumped onboard. Sun has a Java-based Ruby interpreter, JRuby, and the company is about to release a Ruby bytecode compiler. Microsoft meanwhile is developing a .NET version of Ruby, IronRuby, based on its recently announced DLR (Dynamic language Runtime).
You might wonder why on earth Sun and Microsoft are so interested in Ruby. On the face of it, there is nothing earth shatteringly new about the language. Ruby is a scripting language, a bit like Perl, which implements a fairly strict version of object orientation, a bit like Smalltalk. Arguably, it is not so much what Ruby does today that is causing all the excitement - but, rather, what it might do some time soon.
Over the last decade or so mainstream programming languages have become steadily more complex and syntax-heavy. Established procedural languages such as C and Pascal have been adapted by grafting onto them an ‘object-oriented’ layer in order to create languages such as C++ and Delphi. But the resulting languages have been hybrids lacking both the syntactic clarity and the rigorous object orientation of Smalltalk. The same criticisms can also be made of languages such as Java and C# which, in principle, have been designed from the ground up but, in fact, carry with them a lot of baggage from their C heritage.
Ruby, by contrast, makes a completely fresh start. It is not only rigorously object oriented but it also benefits from a simple and decidedly un-C-like syntax. Here, for example, is the Ruby version of “Hello world” in its entirety:
print “hello world”
And just to prove that the ‘simple syntax’ extends to more complex examples here is a brief but feature-complete class definition which includes a method to display the class name of an object:
class MyClass def describe print self.class end end
If you normally develop in C++, C# or Java, the chances are it’s been a long time since you last wrote code as concise as this - not to mention as devoid of curly brackets.
In a way, Ruby embodies many of the features that made Visual Basic so successful. Unfortunately, while the original version of VB was simple and concise, it lacked object orientation. Its successor, VB.NET, has gained object orientation but has sacrificed of a good deal of its simplicity and conciseness.
In spite of the attractions of the language itself, one thing Ruby lacks is a VB-like ‘visual designer’. Some Ruby programmers create visual front ends the hard way using third-party graphics toolkits. My own company, SapphireSteel Software, has released a component that lets you design visual front ends using .NET languages such as C# and then link these to the ‘back-end’ Ruby interpreter. But these are interim solutions. Neither approach gives the developer a drag-and-drop designer which can simply ‘wire up’ Ruby code to respond to events such as keystrokes and button clicks.
The good news is that, for .NET users at any rate, this omission will soon be rectified. When released, Microsoft’s IronRuby will have complete access to the .NET runtime - and this opens up the possibility of making it a truly ‘visual’ language. SapphireSteel Software has already developed a functional drag-and-drop form designer which we are using with the current beta releases of IronRuby.
Up to now, it has been common in the Ruby programming community to refer to Ruby as the ‘new Smalltalk’. Recent developments open up the intriguing possibility that, in the not too distant future, people may be calling it ‘the new Visual Basic’ …
Ruby-In-Steel Developer Overview - SapphireSteel site