Hacker News new | ask | show | jobs
by brabel 882 days ago
Exactly... the JVM is incredibly dynamic. It's gone totally out of fashion because of security and complexity, but I used to enjoy using OSGi to load just about any Java library into the runtime by typing its Maven coordinates, then immediately start using the library from a shell... and then just remove that lib if I didn't "like it" and it would be gone as if it never existed... I don't think a lot of people realize you can quite easily do that kind of thing on the JVM.
3 comments

The feature and bug of the OSGI experience is its rather coarse granularity. It’s finer grained than, say, a WAR, but obviously much different than something akin to the Smalltalk or, to a lesser extent, Common Lisp.

That said, make no mistake, an OSGI module can easily fall into that sweet spot of compiling and reloading fast enough to fall within the cognitive loop of effectively being “instant”.

And if you organize your code well, other parts of the overall app are (mostly) unaware something has changed. Java can be quite dynamic but has not formalized things like dynamic class change lifecycle. OSGI does expose that, and lets the rest of the code tap into that so it can handle change more robustly.

Another alternative is to use JVM plugins like JRebel.
Yeah, it is no accident that a JIT designed originally for Strongtalk ended up becoming the first JIT for Java.

And .NET by being "Java 2.0" after the J++ lawsuit, inherited most of the same dynamism, alongside the ability to support VB capabilities, which by VB 6 were also quite nice.

Part of the idea of WASM components is to support these same tricks with a more modern, better performing standard platform.
That is the sales pitch, the reality is that 10 years later it is still catching up with features offered by other bytecode formats explored since UNCOL came to be in 1958.