News for hackers. Stuff that matters.
Re:WebAssembly: Docker Without Containers by krona on Wednesday December 21, 2022 @06:51AM (#34079441)
JNI? The JVM doesn't sandbox native code, nor can you target the JVM with (for example) GCC. So what are you referring to?
Re:WebAssembly: Docker Without Containers by zozbot234 on Wednesday December 21, 2022 @07:01AM (#34079533)
Why do you need JNI? You could just compile C-like code to run on the JVM using a byte[] array as the equivalent of memory. This is similar to how high-performance Java code is written already, to ensure that GC is completely out of the way.

In fact GCC used to have a JVM target, called GCJ. It was removed due to lack of maintenance.

Re:WebAssembly: Docker Without Containers by krona on Wednesday December 21, 2022 @07:35AM (#34079864)
> You could just compile C-like code

Which also involves rewriting literally everything to Java.

> In fact GCC used to have a JVM target, called GCJ

Which again, had a Java frontend. So, nothing like targeting WASM with C/C++/Rust.

Re:WebAssembly: Docker Without Containers by pjmlp on Wednesday December 21, 2022 @08:10AM (#34080240)
Re:WebAssembly: Docker Without Containers by imtringued on Wednesday December 21, 2022 @07:15AM (#34079658)
That doesn't work. Java web apps have failed. Nobody uses Java in the browser anymore. So even if we use JVM bytecode as the intermediary language you would need to translate that into ASM.js and then you basically introduced arbitrary complexity for literally no reason and you won't have the performance benefit of webassembly.

The browser engine developers effectively paid a huge up front fixed cost and now anyone can use Webassembly in nodejs which then spills over to more and more use cases like cryptocurrencies using a modified WASM VM for their zk sync layer two solution.

The JVM simply wasn't built for these use cases.

Re:WebAssembly: Docker Without Containers by gpderetta on Wednesday December 21, 2022 @07:41AM (#34079937)
we are talking about server side applications though. I don't think anybody runs docker on the browser!

A generic compilation target to the JVM would have worked, but it wasn't available 15 years ago, and GraalVM is mature about now, but so is WASM.