Ravi Mohan's Blog

Monday, November 22, 2004

Back To The Seventies

Sergei Dmitriev wrote an article on his blog about what he calls Language Oriented Programming. Sergei claims "It is time to begin the next technology revolution in software development, and the shape of this revolution is becoming more and more clear. The next programming paradigm is nearly upon us." Unfortunately the rest of the essay is not very successful in establishing this claim.

What he seems to establish is that languages like Java and C# are inadequate for serious programming and makes the developer jump through hoops to get things done and results in lots of verbiage.

Fair Enough. The rest of the article explains a series of necessary languages and the tools required for manipulating them . Brian Selinsky rebuts this line of thinking in his blog .

Brian has two objections.

First , he says that custom languages are difficult to understand because they introduce new concepts which have to be understood by the reader. I think he is partly right.Writing new languages for every minor concept change would end up with weird code. If some set of concepts is better expressed as a library , in frozen languages like Java that is a better option.

But on the other hand one does need languages that reflect the underlying concepts. Using an object based library to do what SQL does well, for example is stupid. (I have participated in a project in which the chief designer went object crazy and reinvented database concepts as an object library . Believe me it is really no fun) .

On the other hand when you do need to "build a language to reflect the domain" the best way to do this is with Lisp Macros .(Doubters should read Paul Graham's On Lisp ).The good thing about macros is the the full power of your lisp environment is available at all points of time.one does not need to rebuild tools for each language defined.

Brian goes on to say "It's quite possible that languages like Lisp failed to become popular (beyond a small community) partially because they encourage programmers to write domain-specific languages. This has a tendency to fragment the community into groups that have trouble communicating (a tower of babel effect). " This is simply not true . The failure of Lisp to "take over the world" has many reasons but this is the first time i've heard that the macro facility was the reason . These minor quibbles aside ,I agree totally with Brian. Asking the typical "enterprise and J2ee expert " programmer to hack macros (or for that matter to use "Language Oriented Programming" to define new languages) is a sure invitation to disaster but this is because you macros are a power tool. You wouldn't ask someone whose driving experience is limited to tricycles to drive a ferrari would you ?

Inventing a whole tool chain to re invent what was essentially complete in the seventies seems suboptimal to me.In other words , learn lisp first . If you have a lot of time on your hands write a lisp library that can call into java and use objects defined in java libraries. That will give you "Language Oriented Programming" (oh nonot another buzz word) without a "technology revolution" .

No comments: