Why Do a Bake-off?

There are several programming languages that interest me lately:

  • Ruby
  • Python
  • Perl
  • Groovy
  • Smalltalk
  • JavaScript
  • Java

Ruby is interesting because I find it predictable. It is fully OO, very high-level, and it has a good application framework (Rails).  I like Matz's focus on how programming *feels*.  I recently bought a bunch of books on Ruby and on Rails. It is also slow, somewhat immature, and its future is mostly in the hands on one person (Matz).  JRuby provides Java integration, but it is too slow and immature to build a live system today (Oct. 2006).

  • Everything is an object.
  • Every function call is a method. 
  • It supports procedural, OO, and functional programming styles.
  • It has closures. It has convenient iterators via blocks.
  • It supports dependency injection.
  • Escape from Ruby is via extensions written in C.
  • Can create a 'compilation' of code into an executable.

Python is interesting because it is OO and very high-level. It finally has an anointed web framework (Django).  The white-space thing took some getting used-to, but I've decided I like it better than having to remember to put in an explicit end-of-block marker (i.e. 'end' or '}'). It is faster than Ruby, mostly mature, and its future is mostly in the hands on one person (Guido), although Google would probably step in if Guido got hit by a bus.

  • Escape from Python is via extensions written in C.
  • Can create a 'compilation' of code into an executable.

Groovy is interesting because it ties into Java well.  It has a web framework (Grails). It seems to be more verbose than Ruby or Python.  I need to look into Groovy more.

  • Escape from Groovy is via Java class files (and presumably via Java native code interface in C).
  • Groovy is immature (Grails is at the 0.2 stage).
  • Can compile to jar files, but not really to an executable (still need a JVM pre-installed).

Smalltalk has been around longer than the others on this page.  I dunno about the image thing.  It has less of a cult following. When I looked into it 15 years ago, I finally 'got' OO programming and I said, "this is going to be really important."  However, Smalltalk has no one leading it and the different implementations have diverged from the ancient Smalltalk-80 'standard.'

  • Escape from Smalltalk via C is available in some implementations.
  • Some Smalltalk implementations can translate programs to C.

JavaScript is interesting because maybe I could use one language for both server-side and client-side.

  • Escape from JavaScript is via Java.
  • I haven't seen any compilers to create executables from JavaScript.

Java is interesting because that's where the jobs are today.

  • Escape from Java is via extensions written in C, complying with Sun's Java native interface.
  • Can compile to jar files, but not really to an executable (still need a JVM pre-installed).

Hmmm... That didn't get me anywhere.  Let's try another approach -- what is special about each?
  • Ruby - Rails has a lot of convenience features.
  • Python - Google uses it.
  • Perl - CPAN and ecosystem maturity
  • Groovy - Tight integration with Java; it's the Java ecosystem without having to code in Java.
  • Smalltalk - It's Smalltalk all the way down to the VM, and it is forces pure OO coding.
  • JavaScript - ONE language for server and client-side.
  • Java - That's where today's jobs are, and it is the most mature/complete ecosystem.

Still no conclusions.  Let's try another approach -- what is particularly scary about each?

  • Ruby - no plan-B for Ruby post-Matz. Slow.
  • Python - plan-B for post-Guido is murky.  Google might pick it up since they use it.
  • Perl - particularly vexing pseudo-objects and generally difficult readability. (Perl 6 isn't releasing any time soon.)
  • Groovy - It is VEERY immature; particularly Grails.
  • Smalltalk - Has a somewhat narrow following, and would scare the bejesus out of a VC.
  • JavaScript - Infrequently use on server-side; JScript is problematic on Windows; no interactive shell like "irb"
  • Java - It is verbose and less agile than scripting languages.

Let's try throwing out the scariest:

  • Ruby - no plan-B for Ruby post-Matz. Slow.
  • Python - plan-B for post-Guido is murky.  Google might pick it up since they use it.
  • Groovy+Java - Groovy is immature; particularly Grails. If I Groovy I'll do it with Java and probably vice-versa.
  • JavaScript - Infrequently use on server-side; JScript is problematic on Windows (use Rhino); no interactive shell like "irb" (Oops! Rhino has a shell.)

See http://ruby.brian-schroeder.de/editierdistanz/ for side-by-side Ruby and Python.


So what?  When I look at Ruby and Python side-by-side, Ruby appears more consistent.  Python's mix of sometimes a function and sometimes a method is not something I want to try and remember.  Python is currently faster than Ruby, but so far, for me, Ruby is adequately fast. 

Maybe I should define what I want:

  • Expressive (brevity of expression)
  • Readable (I can understand my code a year later)
  • Rapid web app development (Rails, Grails, Seaside or similar)

So it comes down to:

  • Expressive and RAD web: Ruby or Python
  • Java platform integration: Groovy + Java (I'm not counting secondary projects such as JRuby or Jython.)
  • Learn one language really well: JavaScript

Rails sure is nifty. The Java platform sure is robust.  Mastering a single tool sure is appealing.

Ruby and Rails have the RAD web thing down pat. Ruby integration with Java is problematic.  Maybe I don't have to learn JavaScript for the client side if I'm using Ruby/Rails libraries to generate the JavaScript?  There is plenty of doc for Ruby and Rails. Google has the potential to create more of a market for Python skills.

What about Groovy and Grails and Java?  Do I have to use Grails with Groovy?  What about RIFE?

JavaScript does have a RAD platform -- helma.  JavaScript can reach out and use Java, although it doesn't generate jars like Groovy. There is plenty of doc for JavaScript, but not much for helma.  Conventional wisdom has it that JavaScript is not as expressive as Ruby/Python/Groovy.  JavaScript is just ugly about OO, although not as bad as Perl.


Now my list is down to:

  • Ruby
  • Python
  • Groovy+Java

I've been doing some reading about the (brief) history of Groovy.  I'm dubious as to whether the project has the juice to succeed, and I can't discern the rhyme or reason of The Groovy Way.  I'm going to do a bake-off between Python and Ruby.