Live data from Hacker News

Ask HN: Why hasn't JVM become the defacto implementation for dynamic languages?

news.ycombinator.com

11–16 of 16 posts

Re: Ask HN: Why hasn't JVM become the defacto implementation for dynamic languages?

#11
One of the really big issues with the JVM (outside of the "It's Java" or "Scary Oracle" stuff) is startup time. Many dynamic languages came into being to scratch an itch for scripting. In those cases, being able to start up quickly is important.

Clojure, Groovy, Scala, and others have shown ground-up dynamic languages on the JVM can be very good and very successful. But that doesn't mean there isn't value outside of the JVM, too.

Once you say "All languages must be on the JVM", you significantly limit innovation, since you are tied to what Oracle decides is worthwhile. For example, it probably makes sense for there to be no tail-call optimization in the JVM, but that is pretty important for a very large class of languages.

Re: Ask HN: Why hasn't JVM become the defacto implementation for dynamic languages?

#12
I think the reason is both technical and social.

The JVM has a very hard time integrating existing C code and extensions. For instance, in the case of python, Jython lacks the ability to take advantage of the significant number of modules written in C.

Consider what this means for performance. Imagine a pure python module that attempts to import a C submodule for performance, and falls back on on the pure python implementation specifically to allow it to run on non-CPython implementations. json is an example of such a module.

This module was likely engineered and architected with C module optimization in mind. I'd assert that in most cases the pure python module is a crutch to allow a CPython-targeting module to run on other implementations.

This leads into the social reason. Community takes a long time to build and using the JVM for dynamic languages is a relatively new trend. The JVM is a very mature, well-optimied technology for static languages. It is only now that dynamic languages are starting to gain traction on it.

Re: Ask HN: Why hasn't JVM become the defacto implementation for dynamic languages?

#13
post #8

Sun was a supercomputer company. Java is the alternative to IBM operating system VM's running on mainframes. Nobody has that kind of hardware just lying around. Java was designed to run on $1000 SCSI hard-drives and 32Gb of RAM. The focus is on standardization, scalability, portability, buzzwords and expensive catering. The guy that made the Chrome Javascript VM sat with a laptop in a small house in the Danish countr…

> Java was designed to run on $1000 SCSI hard-drives and 32Gb of RAM.

This is plain wrong. Java was originally developed as a language for embedded devices, not servers. Later, it was targeted for the web (remember applets?).

These days Java may be best known for being "enterprise", but that is hardly its origin.

Re: Ask HN: Why hasn't JVM become the defacto implementation for dynamic languages?

#14
post #9
post #7

Earlier quoted context omitted.

Sure it's available, but it's error-prone to install, often an old version, and generally breaks all over the place.

There are other implementations too, like IBM J9 and GNU Kaffe. I remember using J9 in place of Sun Java when I was a desktop Linux user.

Oracle has demonstrated a certain eagerness to sue alternative implementations, so I'm not sure those really get around the issue

Re: Ask HN: Why hasn't JVM become the defacto implementation for dynamic languages?

#15
Dynamic languages were not very well served until invokedynamic came about.

If you have a careful look at the Java bytecode, every non virtual function call is resolved at compile time. However, for dynamic languages, function resolution is at run time. And at the moment, it can only be done via reflection, and not amenable to JIT optimizations. However, this is all changing, and if Java could shed some of their static classes (which affect start up time), it has a good chance going forward.

Re: Ask HN: Why hasn't JVM become the defacto implementation for dynamic languages?

#16

One of the really big issues with the JVM (outside of the "It's Java" or "Scary Oracle" stuff) is startup time. Many dynamic languages came into being to scratch an itch for scripting. In those cases, being able to start up quickly is important. Clojure, Groovy, Scala, and others have shown ground-up dynamic languages on the JVM can be very good and very successful. But that doesn't mean there isn't value outside of…

Scala is pretty much the opposite of a dynamic language...
Post reply on HN