Why RubyOnDotNet : DSLs are the future (and you need a dynamic language to create a DSL)

October 14th, 2007 jasonl Posted in Uncategorized No Comments »

Aaron summed up nicely a talk I enjoyed at ReMix. Like David I see a future wherein we are all programming in a plethora of mini-languages aka DSLs. (Have I mentioned that I love Rails and ActiveRecord?).

I was discussing David’s talk with a co-worker who was struggling to grasp why Ruby (or other dynamic languages) are better suited for creating DSLs. At first I was having a tough time making the case for Ruby, until I realized that my co-worker was actually thinking about Fluent Interfaces when talking about DSLs. (David had demo’d putting together a Fluent Interface in C# as part of his talk, in addition to showing off the RSpec, Rails and ActiveRecord DSLs in Ruby).

The breakthrough for him (I think!) was looking at Linq as an example. The extension methods .Where, .GroupBy etc. truly are a great example of a fluent interface and lead to powerful, expressive code. However they are downright klunky and noisy when compared to the new Linq keywords added to C#3.0 like from blah in foo where ... select .... The new Linq keywords truly form the DSL, while the extension methods are just a static-language implementation detail better left to the compiler to generate and abstract the developer from.

Any Ruby or C# programmer can create a fluent interface. But in C# that is as far as you can go. If you want to create a DSL - new keywords, new syntax, new grammar - you need to rely on the compiler writers (or very difficult, kludgy hacks). This is where a dynamic languge like Ruby shines. In Ruby you the developer have the ability to create the DSL. As RSpec, ActiveRecord, etc. show Ruby makes DSLs a breeze.

I find it interesting that Fowler pointed to this ability to create DSLs as the true differentiator between Java/C# and Ruby (as well as Smalltalk, Lisp, etc) back in 2004!

As a result it certainly seems to me that certain languages are more suited to internal DSL than others.

I often find it hard to put into words why it is I enjoy programming in Smalltalk or Ruby so much more than in Java or C#. The most talked about reason is static versus dynamic typing, but I’ve always felt that that discussion misses the point. The friendliness towards internal DSLs is much closer to the essence of the difference.

AddThis Social Bookmark Button

Second release of IronRuby on RubyForge

August 31st, 2007 Aaron Junod Posted in Uncategorized No Comments »

Just in time for a long weekend, John Lam announces the second release of IronRuby is on RubyForge. Congrats to the IronRuby team for the latest release!

AddThis Social Bookmark Button

Wanna post?

August 2nd, 2007 Aaron Junod Posted in Uncategorized No Comments »

I’d love to get a couple other people interested in IronRuby posting here. If you’re interested, drop a comment here or drop me an email at post at rubydoesnet . com.

AddThis Social Bookmark Button

Early Predictions …

July 26th, 2007 jasonl Posted in Uncategorized No Comments »

One of the things I love about July is that the huge void in anything actually happening in the NFL leads to all kinds of crazy predictions. The Superbowl winner will be [insert name of safest bet possible or most outrageous pick]. The top fantasty player will be [again, insert name of the obvious safe prediction or some wild guess]. Both professional and amateur (the guys at work) pundits alike participate in this frenzy to stave off boredom.

Of course such predictions rarely come true, and if they did it was pure coincidence not any particular insight on the part of the predictor.

That’s why I take this prediction that IronRuby won’t succeed as a full implementation able to run Rails with a huge grain of salt. However, the post is a great read if you’re sure to read the comments.

I was ready to post my own rebuttal of several of the claims, but the commenters did a great job of beating me to it. The one claim comment I definitely have to take issue with is the claim that MS will sabotage the IronRuby effort to prevent a Rails implementation as a defense of ASP.NET. This is ridiculous. As one commenter pointed out, if MS can get Rails enthusiasts to host their applications on IIS/Windows that’s a win for them. But it also ignores a more basic fact - that ASP.NET was designed with extensibility in mind. A Rails implementation on IronRuby would do no more to undercut WebForms than other efforts such as MonoRail or other efforts to bring MVP to ASP.NET.

Choices are good for the developers and their customers and good for MS. And as for any predictions, well, as much as it’s fun to discuss such things, I think I’ll wait at least until the season starts.

AddThis Social Bookmark Button