2 ms·
Cross compilation is a toolchain feature, not a programming language capability. As for GraalVM, it has plenty of modes, the AOT one that is being talked about
by pjmlp 2y ago
Cross compilation is a toolchain feature, not a programming language capability.
As for GraalVM, it has plenty of modes, the AOT one that is being talked about here, is native image.
Which can also use a JAR file as input, so even though it doesn't yet support cross-compilation, you can use the JAR file as single source, and then have a couple of build environments in e.g. Github pipelines.
https://blogs.oracle.com/developers/post/building-cross-platform-native-images-with-graalvm https://blogs.oracle.com/developers/post/building-cross-plat...
Does it take a couple of more steps? Yes it does.
To the end user it doesn't matter as long as they get their shinny executable available, and it only has to be done once as a project template.
Also note that cross-compiling only really works without issues for whatever compiled language, if the toolchains have access to every single library from the target system on the host environment, and no dependencies FFI into other languages.