JVM-Based Languages Grow In Popularity

by Ostatic Staff - Jun. 20, 2008

When Sun Microsystems first unveiled Java in 1995, it was hard to define. That's because Java has several parts: It is, of course, an object-oriented programming language. Java is also a standard (or multiple standards, including mobile, standard, and enterprise versions) that defines the language, as well as the libraries that a programmer can expect to have available with each version. Finally, Java is a "virtual machine" (the "JVM"), a software environment on which Java programs execute. You can only run Java programs if you have a JVM -- but JVMs are available for every platform you can imagine, making Java a highly portable language.

One of the fascinating trends that the Java world has seen in the last few years is the growth of non-Java languages that use the JVM. After all, if you create a new programming language, you will need to write it for a particular platform. If you want your language to be portable across platforms, you will need to implement versions for each of those platforms. By contrast, if you implement your language on the JVM, then your language will work on any system with a JVM, which means  basically everywhere.

A growing number of languages are thus being written for the JVM. Four of the most popular are distributed under an open-source license. Given that Java is now open source, this means that you have a fully open-source stack to work with--one that's also portable. Because these languages are implemented on top of the JVM, they also have access to standard Java classes and libraries. This means that if a third-party product includes connectivity routines in Java, but you prefer to work in Python, you can use Jython and access the Java libraries from within your program.

The oldest JVM-based language, so far as I know, is Jython, formerly known as JPython. Jython, as you might guess from its name, is an implementation of the Python language on the JVM. Jython is compatible with the standard version of Python (sometimes known as "CPython") through version 2.2, which means that it is missing some of the newer Python features. The most recent version was released in October 2007 -- but Sun hired two well-known Jython developers earlier this year, and the language can now run the Django application framework, testifying to its compatibility.

Sun similarly sponsors the development of JRuby, a JVM-based version of Ruby. Whereas Jython is one of only two implementations of Python, JRuby is one of several implementations of the Ruby language. However, JRuby is widely seen as a particularly important variation, partly because it has become both fast and highly compatible with the standard C implementation of Ruby. It is able to run Ruby on Rails, in addition to many other functions.

Jython and JRuby are both ports of existing languages to the JVM. Two languages that are totally new to the JVM are Groovy and Scala. Both are growing in popularity; the difference is that while Groovy is more of a dynamic, "scripting" language, Scala is a statically typed language. Perhaps the best-known use of Groovy is in the Groovy on Grails project, a Web application framework (similar to Ruby on Rails) written in Groovy, and hosted on the JVM. Grails has found its way into commercial applications, most notably LinkedIn, where they found that it was much faster and easier to develop in than straight Java. Scala, by contrast, is a very strongly typed language, about which Steve Yegge spoke in a recent talk, and for which he got a bit of flak and pushback on his characterization of the Scala type system.

Java has clearly succeeded as a popular language. It is now growing in popularity as a platform as well, with these four languages just the beginning of what we can expect will emerge in the coming years as language implementers experiment with the JVM.