3 ms·
Two things here: 1. If by runtime you mean "set of files" you can (these days) compile the Graal JIT compiler to a fully standalone DSO/DLL or even statically
by mike_hearn 3y ago
Two things here:
1. If by runtime you mean "set of files" you can (these days) compile the Graal JIT compiler to a fully standalone DSO/DLL or even statically link the results into a larger executable. And because the Graal JIT understands Truffle that means making standalone statically linkable JITCs for any language is now very easy.
But that said, games always consist of more than one file anyway so the importance of this doesn't seem too high.
2. If by runtime you mean "support code" then C, C++ and Rust all have runtimes so you'd really need to define what specifically you need from a runtime.
- IshKebab 3y agoI didn't know that about Graal but I guess it depends on how easy that process is. Remember we're talking about "easily embeddable". You can embed anything with enough effort!
- mike_hearn 3y agoSee here for a guide on how to compile some Java code to a native library: https://www.graalvm.org/latest/reference-manual/native-image/guides/build-native-shared-library/ https://www.graalvm.org/latest/reference-manual/native-image... One of the kinds of code you can compile this way is a language interpreter using the Truffle framework, which is a way to write interpreters that turns them into advanced JIT compilers automatically. If you do that then your language interpreter, runtime and the Graal/Truffle JIT compiler will all be compiled into your shared library. You can then export a C API from it using the technique shown in that article to load and execute code.