Saturday, November 05, 2005

Its just syntax, or is it?

Holy wars abound in the lore of geekdom. Fans of a particular programming language waiting to castrate their brothers in profession, just because they use a different language. You can call this racisim of sorts, but its based on syntax or rather the programming language in question. The members of the big ones like Java/C++/Perl go to war with each other, while they are more than content with conducting witch-hunts for the patrons of less popular syntaxes. (I would give an exception for lisp - an average lispnik's arrogance usually forms the "force field" to ward off any war that might come their way).

But incindently, many fail to understand that its just syntax. Yes, language is important in the sense that it is the way in which you 'talk' to the computer. The better vocabulary it has, the better it is. But again, its just syntax. And this thought has been ringing in my mind ever since I started out with lisp. I was comfortable doing all my programming in Java without macros. Now, I cannot live without them, every other language is incredibily constraining. So, syntax has more to it that I initially thought. And this was one of the reasons that motivated the common virtual machine which should make it easy for implementation of other languages over it. The virtual machine provides a basic set of primitives that can be used by the compilers to generate code for the virtual machine, which the virtual machine can then execute.

My virtual machine apart, what was the most amazing thing so far was that, most of my thoughts were echoed by Mr.Sridhar Vembu of AdventNet. His Deluge system which is more centered on deployment of web applications, is basically very similar, however, it represents all its items as tables. Everything from the code to the data it manipulates. Though it solves a lot of problems (like R-O mapping, etc..) one of the things that caught my fascination in the system was that, it has this underlying theme of "Its just syntax". So ones who would want to use 'code-writing' code style macros with lots of paranthesis are free to do so, while others who are more than happy with VB style code can go ahead and code. The internal representaion of code is in the form of tables. (Though *I* would feel a tree-structure is more natural, I guess there there is a trade-off there between uniform representation and what feels natural).The whole thing has one common internal representation which can be converted to your favourite synatx and back to the internal representation seamlessly.

Now, that solves the syntax problem, but what bothers me now is the continuim problem (I gave it that name.. so you won't find that anwhere else). So what is this continium problem? Its explaination is a bit more involved, but here is it.

Any programming team, can certainly benifit if it has 'god level' programmers. Usually, those god level programmers are those that don't mind using a weirder language if it can offer the power they want. If one problem can be solved quickly with a certain style natural to the programming languge, they would have no problems doing that. Given, that they have seamless interoperability, it might be very natural to write different parts of a problem in different syntaxes. The harder (and thus more expressive/cryptic syntaxes) are the ones that might end up giving high productivity. So any profitable enterprise needs people with high productivity.

On the other hand, new recruits are part and parcel of business. Its easier if the newbies start out with much more english like and friendlier syntax than say something that looks like 'fingernail clippings in oatmeal', so again it brings down the training costs, or rather spreads it out. Now the problem as I can see it comes from something I guess is part of human nature. Complacency. What happens if the newbie is comfortable with the current language, he might get the job done, with the same quality as what an expert would have done (I am assuming the newbie doesn't skip on basic discipline like error checking, etc.). But what if he had used the same tools/syntax that the expert had used. He could have finished the product faster, and easier.

So the problem is, again in syntax, or in this case a series of syntaxes that can make a newbie's transition smooth to that of the expert domain. A series of syntaxes so that a newbie can learn and slowly grow out of. In the process of learning more powerful (and hence cryptic in some-way), consturcts and concepts, the transition is smooth and as natural as possible. So thats the problem I guess we should be looking at. The problems in programming languages have moved from hardware to mushware (human brains). And we need to find solutions to appease mushware.

Signing Off,
Vishnu Vyas.

No comments: