The JVM as a Target Platform

Posted on June 8, 2009

0


* Warning: there might be some typos here and there.
CC-by-SA

Listening a few of the latest JavaPosse [1][2] and se-radio.net [3][4] podcasts, I get the impression (or should I say, re-affirmation) that:

  1. Java (the language, its syntax and evolution) is at a particular crossroads, and
  2. The JVM is being underutilized as a target platform.

What are your thoughts on alternative languages running on the JVM? By these I don’t mean specific languages and their pros and cons (.ie. Scala‘s peculiar syntax, or Groovy‘s alleged performance problems).

What do you think of the idea, the concept, the feasibility?

When I first picked Java in 1995, right off the Gosling‘s oven when people were still referring to it as “Oak” (it’s original name), people were very sure that this was a toy language, and that it had no fit in the enterprise world.

Fast forward 14 years now… hmmmm, yeah.

A couple of things to consider:

  • Although Java introduced new concurrency tools, there is a load of applications out there that still run in the old concurrency model (and sooner or later get hit by Moore’s law.)
  • The EJB standard explicitly forbids the creation and management of threads within a EJB (so how that will affect using multicore platforms?)
  • Most Java developers are not familiar with Actor/Task-based concurrency models, which (usually) happen to be more robust and scalable that what has usually been implemented in Java with the synchronized keyword.
  • Spring, the de-facto IOC allows injection of Beans written in other languages.
  • Java is nowhere near implementing functional-programming constructs. At the time of this writing, even C++ is on the verge of implementing lambda functions.
  • The .NET platform and its run time provide an exuberant target for multiple languages, almost reminiscent of the GNU compiler suite. F# with its support for functional programming comes to mind. Powershell runs on it. Haskell is on the horizon. The JVM, on the other hand, despite being a superior target and virtual machine, lacks this. It is seriously underutilized as a target platform.
  • With its clunky generic system, boiler plate code, and even clunkier “configuration-hardcoding” attributes, Java has, in many ways, being surpassed by C# as an efficient language for development.
  • The ideal of a one-language shop is a fallacy. Anyone that has practical enterprise experience will now that, in many cases, a mix of Java/C#/whatever with vendor-specific SQL, batch/cron jobs, rsync and unix shell scripts usually make up for the best solution (not that I’m claiming this is pretty, but it is what it is; you do what you need to do to get it done in the best way possible.)

Java is not going anywhere, and nothing else provides its capabilities for enterprise integration. But facts of concurrency, functional programming, boiler plate code, its difficulty to clearly introduce constructs that now recognized as vital to practical software engineering makes its evolution a question mark. On top of that, the insistence of being backward compatible all the way to Java 1.1 makes things harder to evolve.

So with that in mind, where do you see other languages targeted to the JVM?

Purely hypothetical, what would be the venues and manners in which, within reason, alternative languages can enter the enterprise?

How will languages like Scala and Groovy (in addition to parallel evolution of C#) affect the evolution of Java and its syntax?

Also, and to add more complexity to the issue, there is also the risk of going overboard with multiple languages for a single solution. So there has to be a pragmatic reason to introduce a new language to implement (or extend an existing) solution.

http://www.codecommit.com/blog/java/the-plague-of-polyglotism

So with that in mind, I’d still like to hear your opinion, pros and cons, specially those based on experience, or anecdotes passed down to us from 3rd parties that have already jumped into alternative languages for the JVM.

What do you think?

ps… I’ve just learned from a close friend of mine that a large, local IT shop is looking to actually migrate their system, in whole or partially, to one of these new JVM languages. I’m not so sure about the choice of technology for the specific task at hand, and I won’t divulge the details until I know more about it. So take it for what it is, and draw your own conclusions.

[1]Java Posse #253 – Roundup 09 – Java Language a Productivity Dead End?.

[2]Java Posse #228 – Roundup 08 – Scala in the Enterprise.

[3]Software Engineering Radio – Episode 62: Martin Odersky on Scala.

[4]Episode 15: The Future of Enterprise Java.

CC-by-SA

Advertisements
Tagged: , , ,