I'm not passing any opinions about any languages or VMs here.
I'm not passing any opinions about any languages or VMs here.
Is this mostly JRE? Would Jigsaw help, or is SubstrateVM already doing something like that? (To be clear, this tech is really impressive! Just trying to get a sense of embeddability constraints)
Language VMs compiled using SubstrateVM are larger than you may think because as well as the native code they also need to contain a representation of the code that the compiler can read (IR) so it can dynamically compile the methods that are combined to form the compiled version of your user's code, and we also need to compile a sort of runtime debug information that allows us to jump from optimised code back to the native code when an optimisation proves to be wrong. This is a novel thing - most language VMs jump from optimised code to a bytecode interpreter - we have to jump back to the native code as there is no bytecode interpreter. Finally, a language VM also needs to include all of the Graal compiler itself for dynamic compilation, which is quite a bit of code.