Matthew Huntbach takes a long hard look at the coolest language on the planet and is distinctly under impressed by what he sees…
Friday 16 March 2007
by Matthew Huntbach
Tim Sweeney’s talk The Next Mainstream Programming Language (PowerPoint PPT) is in many ways an antidote to the recent Ruby hype. Tim calls for the use of stronger types to ensure program reliability. He praises the academically-developed Haskell functional programming language. He raises concurrency as a feature which must be tackled in the next big programming language, using a better model than the shared state with threads and mutual exclusion devices used by Java - and by Ruby - (...)
I am no fan of Ruby. Like the author, I find it rather ad hoc.
However, he’s missing the point in a lot of areas. Just to take one, he seems to think that duck typing’s sole benefit is to eliminate the need to specify types. What he doesn’t seem to realize is that this is merely a side-effect.
The real benefit is run-time polymorphism. Try explaining to CS101 student that "an object will respond to a method invocation if it has a method with that name". With some work, you’ll probably manage. Then try explaining Haskell’s type classes, compile-time polymorphism and its generated code, union types, intersection types, type-inference, the reasons for homogeneous data structures, etc... it suddenly becomes a lot more to handle conceptually.