I wonder if JVM bytecode would be a viable alternative intermediate language for compilation-to-javascript, as compared to the LLVM IR that projects like Emscripten use.
> I wonder if JVM bytecode would be a viable alternative intermediate language for compilation-to-javascript
That would be very cool! In fact I've been thinking about compiling JVM bytecode to JS using Emscripten. Either by compiling JVM bytecode to LLVM IR, or directly to Emscripten's IR (which is a close parallel to LLVM's).
If any JVM hackers want to work on that with me, that would be awesome (I can do all the LLVM/Emscripten parts).
I'm not sure I expect a "real" JVM to end up back in the browser, but everyone these days does seem to be trying to compile everything else to JS by hook or by crook, so anything that serves as a halfway plausible IR for that is interesting. The LLVM IR, for example, is used more or less because it was the least-bad option, not because it's great for the job (the Emscripten list has a lot of discussion of how not-really-platform-independent it is).