Wednesday, November 5, 2008

The new programming languages discussions

I am spending time getting a hold of the new approaches on programming languages.

Many years ago, I discovered Bentley's Programming Pearls (http://www.amazon.com/Programming-Pearls-2nd-ACM-Press/dp/0201657880/ref=sr_11_1/176-0790589-8960217?ie=UTF8&qid=1225956297&sr=11-1). I have true love for well defined "little languages" that have a clear purpose and deliver it with elegance, concision.

I was lucky to work around a language for a business rules engine, and I remember with fondness the long discussions around language design and pretty important things that are now obvious but back then, in my youth and the earlier days of OO, seemed subject for debate: value versus object, object identity versus object state, etc... How the Java JDK got it wrong in a number of classes in java.util.
And the sempiternal debate around strong vs other typing systems.

Since then I discovered (through Paul Ford's excellent ftrain.com site) Processing (http://ftrain.com/ProcessingProcessing.html), a very nice language. And then many others.
However my work diverted my energy into less fun stuff, repositories, server side infrastructure, etc.. And management (see other posts...)

But now I am back to more fundamental thinking about all this, and it's now starting to make sense again. DSLs (graphical, syntactic) constructed using tooling provided by dynamic languages leveraging DLR support resting on language neutral VMs for which the low level core code is written in strongly-typed Java like languages. "Mais bon sang, mais c'est bien sur".

The low level core code needs scalability, performance, compile time checking for mission critical code. Java gives you that - and yes, Java does give you that, hotspot compilation is doing wonders this day.
The dynamic, sometimes reflective, languages in the middle (and I will call dynamic even those that do 'duck typing' - 'if it looks like a duck, it sounds like a duck, it smells like a duck, then it's most likely a duck') give you productivity - and Python and Ruby have proven they can deliver and be safe. The 'Da Vinci' VM, even more so than the DLR effort on .NET, promise to combine dynamic language interoperability (making it easier to free DSLs from the tyranny of the underlying supporting programming language) and performance (enabling hotspot compilation) (read John Rose's very instructive blog: http://blogs.sun.com/jrose/).
These dynamic and reflective languages enable the easy creation of maintainable DSLs.

This is powerful.
Makes me rethink a lot of things.

Then there is the question of 'model driven' versus 'dsl driven'. For me, at a high level, DSLs are there to express the models; and, in the other direction, models define the boundaries for the DSLs. The key is that DSLs should not express more than the corresponding models (lest they become just other horizontal programming languages), but they should express them fully, with all the required flexibility, with elegance and in a concise fashion.
Back to the beginning of this post and Bentley's pearls.

But this is a big exciting subject. It will keep me awake at night. Complicated, but in a good way ;)

No comments: