4 ms·
JNI? The JVM doesn't sandbox native code, nor can you target the JVM with (for example) GCC. So what are you referring to?
by krona 4y ago
JNI? The JVM doesn't sandbox native code, nor can you target the JVM with (for example) GCC. So what are you referring to?
- zozbot234 4y agoWhy 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.
- imtringued 4y agoThat 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.
- gpderetta 4y agowe 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.
- krona 4y ago> 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.
- pjmlp 4y agoHere have fun, http://nestedvm.ibex.org/ http://nestedvm.ibex.org/
- deleted 4y ago[deleted]