FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
Architecture Blog: The Languange Conundrum: What Should I Choose? What Should You?
Architecture & Design
PATTERN LANGUAGE

Modeling, Managing, Making it Right.

by Jonathan Erickson
IF YOU BUILD IT

... Will they Come?

by Arnon Rotem-Gal-Oz
October 25, 2007

The Languange Conundrum: What Should I Choose? What Should You?

I am currently interviewing people for developer positions for my startup (PaperLnx), and as I described my plans to use multiple languages to one of the candidates, he immediately retorted "Why on earth would you want to do that?"

Why indeed?

As I mentioned in the previous post about F# and Erlang, it seems to me that the age of "one size fits all" is ending in a lot of areas. I think that it is also happening for languages.

When .NET was announced, one of Microsoft's messages was that .NET is the platform and that you can choose any language you want to develop in it. Microsoft also worked with partners to back up this
statement and released a lot of languages for the platform (e.g., Eiffel# , Fujitsu NetCobol etc.) vs. Java, which was a single language with a "write once, run everywhere" vision. Microsoft itself released two manages languages -- VB.NET and C# -- and managed extensions for C++. The C++ managed extensions were awkward to work with and only people who really had to used it. The non-MS languages seemed to be niche languages for legacy integration and not much more. VB.NET (we're talking .NET 1.0 here) seemed like something to try to distract VB heads while Microsoft was pulling the rug out from beneath them. Which basically left C# as the only viable language to develop in if you were serious about .NET (at least in my eyes). The "many languages" vision seemed like something to hide the (obvious) fact that Microsoft had to come up with an answer to Java (especially since around the same time Sun also sued Microsoft over the
J++ and JVM implementations)

Five or six years later the situation is a little different. For one thing, we see that the JVM is not just about Java anymore. Just like the original .NET vision, the JVM has become a platform supporting many different languages -- Jython, JRuby, Scala, and Groovy , to mention a few.

The .NET platform is also getting more interesting languages like Boo and Gardens Point Ruby.Net . .NET is also being extended by Microsoft itself (with IronPython, IronRuby, F# ).

Two interesting things you see are:

  • Suddenly the languages are cross platform. e.g. I can program in Python and deploy it natively, .NET or on a JVM -- so in a way you get some platform independence.
  • The other and more significant issue (to my eyes) is that the languages available on each platform are different enough in meaningful ways -- to a point where it is getting worthwhile to use more than one language in projects. Here are few examples from around the blogsphere that demonstrate this:
    • Neal Ford shows an example using the (excellent) Mocha mocking library (in JRuby for testing Java classes). So the dynamic properties of Ruby help make the testing simpler for the statically typed Java.
    • The BOO Build System (via Ayende) -- which is about building a DSL for builds (a la rake ). Again we see taking advantage of the properties of a dynamic language this time to help with .NET languages.
    • (not) Dennis Byrne shows how you can call Erlang from Java -- which demonstrate taking advantage of the concurrency features of Erlang from Java.

When it comes to the difference between general-purpose languages (i.e., Java, C#, VB.NET) we mainly see syntactic nuances. When it comes to dynamic languages vs. static languages vs. functional languages, the differences are more meaningful. What has changed now is that both platforms and open standards (e.g., REST over HTTP/WS-*) enable better integration and increase the motivation to use the "best tool for the job" approach over "the everything looks like a nail" approach .

I think the time for language pluralism is ripe. In my solution this would probably translate to a mix of C/C++, F#, C# and Ruby. What about your projects?

Posted by Arnon Rotem-Gal-Oz at 06:05 PM  Permalink




 
INFO-LINK