← Back to context

Comment by jayd16

9 hours ago

Uhm, Kotlin does compile to native without the JVM doesn't it? It runs in the JVM for Java interop, no?

https://kotlinlang.org/docs/native-overview.html

Pretty sure it’s the other way around: Kotlin was implemented on the JVM and that’s its primary target, and got a native implementation later for folks that don’t want to run a JVM.

  • Is that relevant? Kotlin fully exists without the JVM, as requested.

    • Sort of? The kotlin standard library yes, but it’s pretty rare to write an app with only the standard library. It feels like you’re dismissing the Java interop as a secondary benefit, but for most uses of Kotlin it’s probably more important to project success than the language itself. So I think it’s accurate that without the JVM Kotlin would be essentially dead.

      2 replies →

    • A subset of Kotlin has a native backend, not good enough to power JetBrains products, which still require Java Virtual Machine.

      It is so good, that JetBrains themselves rather use Rust or C++ for native code libraries on their IDEs, and not officially supported on the Android NDK.

      3 replies →

Nope, the JVM is the main platform, and also used for Android development, which by the way, still mostly uses Android Java on the platform code.

Kotlin Native came later, its memory model was incompatible with Java, thus breaking portability for libraries between JVM and Kotlin Native, thus Jet Brains had to reboot Kotlin Native memory model.

https://blog.jetbrains.com/kotlin/2021/05/kotlin-native-memo...

Currently it is mostly used to port Android code into iOS apps, hardly something that even JetBrains could show off running their IDEs on top off, nah, they still need the JVM.