1 Aug 2008

Java is the new C

Till recently I thought of JVM programming languages as a bad idea — that the JVM didn't really offer much for a dynamic language implementor. That may be true technically. But if technical factors were all that mattered, we'd all be programming in Lisp, Haskell or Ruby. While a lucky few may get to use the powerful languages, most of us can't, for valid reasons. Because the software we have to interact with is in a different language, or because the company has a ton of internal libraries that have to rewritten for each new language, and maintained. This is the case at Google, for instance.

Programmers fall into three levels here. At the top are the lucky few who can use whatever language they want, and at the bottom are the unwashed masses who'll use whatever language the other guy is using, but in the middle are those who want to move up the ladder but can't. Anything we can do to decrease the barrier of adoption helps the second group, and eventually everyone. And it's not as if having a lot of users hurts the language.

Currently, moving to a new language means learning the language itself, and then its libraries. What if we remove the second component by leveraging, say, the JVM standard libraries? Java, like it or not, has become something of a de-facto language, which means there a lot of people who are comfortable with JVM libraries, so if we offer the prospect of a better language without having to learn brand new libraries, maybe that will be more widely successful than a blank slate approach?

There are also other advantages, like more easily being able to invoke other components written in Java or writing performance-sensitive parts of the program in Java. One of the complaints against dynamic languages is performance, and instead of writing performance-sensitive pieces in C, one can write them in a much higher-level but still reasonably fast language. Besides, the interface between the dynamic language implemented on the JVM and the Java language (say, the Jython-Java interface) will most probably be orders of magnitude cleaner than the equivalent C interface, like the Python/C interface.

Java not only has a lot of users, but it could serve as the substrate for other, higher-level languages. In that sense, Java may well end up being the new C.

No comments:

Post a Comment