Comment by pron

11 years ago

> it has a feature superset.

True, although the most relevant difference is value types, which Java is getting, too. As to the rest, it's not about the number of features, but the quality of implementation. HotSpot's JIT and GCs are simply years ahead of the CLR, and HotSpot's next-gen JIT, Graal, is another tremendous leap forward.

> The CLR is generally much faster to start up

Compared to HotSpot, yes (but, like you said, there are many JVMs out there), although Java 9's JIT caching will change that.

> The library linking story is much more pleasant too, with a single dynamically linked executable referencing GAC-installed assemblies, rather than stringing together enormously long class paths.

This, too, is no longer the case in Java 9, but the difference in the other direction is much more relevant: the JVM's agent capabilities (both Java and native agents) are one of the things that give the JVM its power. The ability to easily transform code as it's loaded (or after its loaded) packs a lot of oomph.

In general I'd say that the JVM offers fewer abstractions, but more powerful ones and it offers less opportunities for hand-tuned optimizations and more for automatic optimizations. In the end, HotSpot is simply much more advanced internally. The CLR is like a car with more buttons, but HotSpot is the car with the better engine. HotSpot has always opted for constant change that's hidden from the user, while the CLR has been adding more and more user-accessible features.

The work being done on Graal/Truffle is so far ahead of anything anyone else is doing, that it will put HotSpot's JIT beyond the reach of any other technology for years to come. It seems to me that the CLR might even stop competing and C# might switch to AOT compilation, with VB possibly being abandoned. Some of the latest moves by MS seem to hint in that direction (RyuJIT was already done or nearly so).

Graal/Truffle looks lot like DLR. Are they similiar ?

  • I assume their purpose is similar, but they are really a framework for building very sophisticated JITs -- much more than HotSpot's current optimizing JIT, which is state-of-the-art -- with user-controlled code generation. The CLR has a very primitive JIT to begin with. So while the purpose might be similar, Graal/Truffle represent the future of JITs, while DLR is just a framework that helps implementing dynamic languages for the CLR.

    • Minor correction: what I said about a similar purpose is true for Truffle. Graal is a general-purpose, optionally-user-controlled JIT, that can (and probably will) be used to JIT Java bytecode in addition to Truffle AST nodes. So it's basically just Hot Spot's next-gen optimizing JIT compiler.