I’m thinking about using Kotlin for a native application an wonder whether it would be better to use Kotlin Native or GraalVM. As far as I know Kotlin Native it seems to have some serious limitations:
- Worse performance than Kotlin on JVM
- Not all Java libraries and frameworks are usable
- IntelliJ doesn’t support Kotlin Native (only CLion), although I remember that this limitation should be lifted
Then there is GraalVM, Oracle put a lot of effort in, and what seems to be a very powerful compiler producing fast executables.
@mikehearn wrote on his blog:
Kotlin doesn’t need an LLVM backend, and by extension I believe neither does Scala. Creating such a thing would be a huge and ongoing drain of manpower, take a long time, and end up duplicating work already being done elsewhere in the JVM ecosystem … very likely with worse results.
What a the pros and cons of using Kotlin Native and Kotlin + GraalVM regarding the following points?
- ease of use (compiler setup, build tools, etc …)
- usability of Java libraries / frameworks
- usability of other libraries / frameworks (C and the like)
- speed of execution
- memory usage
- versatility
There was a related discussion in this forum: