3 ms·
You can actually run non-GC languages on the JVM because it does expose a manual memory allocator. That's how the WASM and LLVM support work. In that case the G
by origin_path 4y ago
You can actually run non-GC languages on the JVM because it does expose a manual memory allocator. That's how the WASM and LLVM support work. In that case the GC gets out of the way (or is used only for Java objects). Of course in that case a lot of the benefits of the JVM aren't there, but if you need to do JIT compilation+manual memory management then it can make sense.
The real question I think is, if it weren't for particular technical choices by the browser people, would anyone care about JIT compiling C? Probably not. We know how to sandbox C/C++/Rust without a JITC, nacl and other initiatives have proved that. Portability, so what - there's really two CPU archs that matter and new ones don't come along very often. Cross compilers work. The GraalVM guys have found a good reason to JITC of C for language interop and interpreter extensions but that's pretty special case.