by grizzles · 10y ago · 0 comments
The JVM ecosystem and Hotspot are certainly modern marvels, but there's hurdles greater than the potential benefit.
Indeed - if there's one thing that this case has shown it's that java is poison legally. If a company the size & power of Google is being forced to take a project the size & importance of Android places they really don't want to technically, well, that's a very big deal. And I wouldn't like to think what would happen to any smaller group that wanted to take a java technology down a path that isn't Oracle-approved.
I don't see anyone adding Java back into the browsers, that ship probably sailed.
I also have a huge problem with the litigious nature of Oracle... However, this would mean that something was settled and might reduce the likelyhood of future lawsuits especially in regards to patents or copyright. WebAssembly didn't go thru that process which might mean that if it picks up some anonymous patent holder might start attacking it. It is vendor neutral though, which is both a plus and a legal liability as there is no single "responsible" entity.
I can picture Google's lawyers using that in court against Oracle.
> then the litigious organization issue might have been too
That might is a big MIGHT, the same kind that keeps browser vendors from shipping various media codecs and news companies from using various media streaming protocols.
> WebAssembly doesn't have a GC
The GC all browsers currently have and will not get rid of that I was referring to was the JavaScript VM.
> It also doesn't have ~20 years of performance tuning on different microarchitectures the way the JVM does.
And the JVM doesn't have the start up performance of any JS VM. I would estimate the number of exploits to be significantly higher for the JVM, but worth less.
> Benefits include getting scala, clojure, jython, jruby, and about 30 other languages working client side in the browser for free.
JS is the most compiled to language in existence. Also, my point has been none of this would be free. How do you integrate JVM with DOM? Who's going to rewrite all that? Who's GC cleans up around here?
> Not to mention the languages that have been statically compiled will run way faster than the equivalent JS.
Are you talking about WebAssembly here? Cause it sounds like you are.
Google chose not to use OpenJDK (and they've obviously not complied with its license so far), so it being open source is irrelevant.
From what I understand open source and imunity from litigation are orthogonal. Open source code and still be a patent minefield.
[1]: That grant is automatic, by the open source license. In addition (and unrelated to OpenJDK), there is an explicit patent grant to conformant implementations of Java (be they based on OpenJDK or not).
Citation needed :)
> It also doesn't have ~20 years of performance tuning on different microarchitectures the way the JVM does.
JS engines have been tuned very well over the years. Remember that Web Assembly is designed to run in a JS engine.
Is it? It's a very low-level bytecode that's designed to be efficiently compiled in one pass, and completely unrelated to the JS engine. It isn't meant (at least at this time) to have an optimizing JIT (like HotSpot or V8). It is meant as a good target for languages that don't rely on/can't benefit greatly from good JIT optimizations, such as C/C++ (or Rust).
Of course, one could compile a JVM to wasm, provided that wasm allows applications to write to executable memory (which I doubt).
Yeah... because it's assembly. That's the whole point. You don't WANT a GC. It would be the wrong layer to place a GC in. Ask most professional game developers if they would consider using a platform with a GC. They won't, because you can't build a realtime system without stuttering if you're dealing with a GC.
Besides, we already saw what java-in-the-browser looks like, and it was a huge failure.
Yes, they pretty much are[1], and yes, it is[2].
Their 80 kLOC JS compiler is on par with V8, they're matching or beating PyPy when running Python, and their Ruby performance is out of this world. The downside, though, is that it has a long warmup time, which makes it unsuitable for web pages.
[1]: https://www.youtube.com/watch?v=OUo3BFMwQFo
[2]: https://twitter.com/ChrisGSeaton/status/619885182104043520
Stick a regular, unprivileged JVM, with no secure classloader magic, inside a straightforward non-Java low-level sandbox like NaCl or even just PPAPI + Chrome's renderer sandboxing (like Pepper Flash or PDFium) and it'll probably hold up just fine.
And honestly that's what Android does. Java isn't a security boundary on Android, and the NDK makes this explicit. Each app runs as its own UID, and the kernel is taught to isolate users a bit more than usual for UNIX, and that holds up pretty well -- not perfect, but far better than the Java plugin does.
(To be clear, I'm not advocating the JVM as a platform for web content. Just that, if somehow it turns out that the JVM is in fact the right platform, the sandboxing problem not a blocker.)
Both Firefox and Chrome ship massive numbers of security fixes with a high degree of regularity, but nobody cares, because:
1) It's the web, and The Web is close to religion for many people.
2) Their auto update mechanisms are pretty good, for Chrome, best in class, so people get the bug fixes.
The JVM sandboxing mechanism itself isn't the issue. The design is sound. All sandboxes have escapes especially where native code is concerned, and JavaScript sandboxes have proven no different in this respect. The issue boils down to auto update (lack of).
Especially when it comes to sandbox-escape security vulnerabilities! Among web technologies, HotSpot has historically beaten even Flash in that area.