Hi, I'm new in Kotlin/Native topic, but plan to us...
# kotlin-native
l
Hi, I'm new in Kotlin/Native topic, but plan to use it more. I noticed that when I try to compile literally hello world kotlin program with
kotlinc-native
, the
java
process is launched. I tested it on
linux_x64
and
macos_arm64
targets. So does Kotlin/Native compiler use Java under the hood by default?
j
Yes. The compiler (regardless of backend) is written in Kotlin and only runs on the JVM.
😢 1
m
And what exactly is your problem with that? Also all the tooling around Kotlin, like Gradle for example, is running on the JVM. IMHO the only thing which counts is that the output (the native executable) does not depend on a JVM.
l
@Michael Paus not even a problem, but as long as I plan to use lightweight text editor + compiler setup, I won't use Gradle and other overcomplicated solutions. E.g. yesterday I managed to set simple Fleet run configuration for running Kotlin/Native terminal apps
h
While Kotlin is independent of a specific build tool, Gradle is the preferred one and hides many configuration/compiler invocations behind Gradles API (for the better or worse). If you plan to split your code into multiple modules or if you want to consume published Kotlin native artifacts, it is quite easy to just use Gradle. Otherwise, you need to download the dependencies by yourself and configure the compiler (all the things a build tool does).
l
@hfhbd I see. But for Native language ecosystem I usually expect relatively simple instruments, like
pypi
,
pub
,
cargo
,
cabal
, etc.
g
I mean all what you are saying are lies in the area of personal feelings, what is overcomplicated or what is simple Gradle has probably way more features, but again, not that it matters for most cases How is it different, native or not, I would like to have a normal build system and dependency management for our native C++, if it on jvm or not Also, if you use kotlinc compiler, there is no Gradle, just compiler which runs as Java app. It was acutally AOT version of compiler, but it's more like an experiment and not really better outside of running some very small single file compilations (because it wins on start up time)
🙌 2
🆗 1
a
How is pypi lightweight? It requires a full Python runtime. And it is far from “native”. You almost can not higher level. It is like saying “npm” is lightweight. I do not see any relation between native development and “lightweight tooling”. In the end as a developer you want to get shit done with the right tools for the job.
👍 1