Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

GraalVM can build native images: https://www.graalvm.org/docs/reference-manual/native-image/

I haven't heard of kotlin-native, but apparently it isn't using GraalVM under the sheets which is interesting.



Kotlin Native predates the release of native-image. Also it's actually a slightly different language. Kotlin/Native really wants you to not write shared memory multi-threading. All variables are thread local by default. It has special constructs for interop with C libraries, and uses a sort of reference counting Python-esque memory manager if I recall correctly. You can only use C or other Kotlin/Native libraries.

GraalVM native images are a different matter. It uses the Java memory model and ahead of time compiles all the code to native. The "VM" part is bundled with the binary but it's very small and thin. Really it's just a simple generational GC and a bit of support for reflection over things you said you want to reflect over.

Both produce small binaries that start as fast as C programs do. In fact the GraalVM team have advertised cases where native-image binaries start faster than C programs do.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: