I read about the GraalVM and the SubstrateVM framework. I understand that the native-image
command can be used to create native applications from Java source files as follows:
$ javac Hello.java
$ native-image --no-server --no-fallback Hello
$ ./hello
Hello World!
$
This creates a native binary hello
, which is - according to this question - powered by the SubstrateVM framework, which provides...
...other things (runtime) needed to actually run ahead-of-time compiled Java bytecode without a JVM.
This is unclear to me:
- When and why is the SubstrateVM framework required? Is it required at native-build time only or also during runtime? Does the
hello
binary consist of pure target machine bytecode or is there still Java bytecode and a fully-fledged virtual machine embedded, namely the SubstrateVM? - Which overhead requires the
hello
native image to run compared to a usualHello World!
C program?