I'm waiting for java independent Kotlin compiler
# kotlin-native
k
I'm waiting for java independent Kotlin compiler
👍 1
d
Likewise! It's all Kotlin in the end, isn't it.
k
Yup 99% Kotlin in it but I don't know but still need java. So thing 1% is still java
g
Kotlin Source != Java independent Kotlin compiler (for all platforms) is a huge JVM application, I doubt that it would be easy to run on other platforms even if it would be 100 Kotlin, you need a lot of platform specific code and libraroes, which now JVM specific Also what would be a point of this except curiosity and challenge to do so?
k
Sorry I was talking about native compiler.
I like more Kotlin native then kotlin
f
Why do you prefer kotlin native over kotlin jvm?
s
that would have been possible if they listened to complain on day 1, betting on java is adding extra heavy useless dependency
they can't get their compiler bellow 100mb since they need JRE
and then you add Gradle
another 100mb
not only that, but now you need to also warm up JVM to get fast startup for CI
so you add extra overhead
when stacked up, all these choices starts to become a real issue
g
Kotlin Native compiler is essentially just a part of Kotlin compiler, and integration will be even closer in future with new compiler backend
Java is not useless dependency, it provides a lot of value, and tools, if you get rid of Java you still need a lot of tooling and libraries to replace it
another 100mb
Any other native build tools are huge, llvm toolchain for one platform, required to build K/N program is a few hundreds megabytes Believe that you have "overhead" only in Java is pretty naive
k
https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/java.html In every task margin is 2-4 sec which is huge for large programs. For small programs it's make no difference but when program goes bigger you will feel bottlenecks of Java.
Machine code executable is the fastest and smallest form of software.
g
This is also extremely naive understanding how Java works, and you can check any real life benchmarks, like web servers ones for example, Java frameworks also on top It's not about machine code at all, Java also uses machine code to run programs, it called JIT There is no bottlenecks, there are very different languages, technologies with own set of pros and cons, but no bottlenecks And funny that you are talking about using K/N because of performance reasons, for now Kotlin JVM performance is many times better than K/N. K/N only have faster start time which is expected of course
s
there is no way for things to progress if people are in denial of reality
ask people why they prefer GO over java nowadays
and ask them how much money they save since they moved to go in hosting
with java you always forced to pick higher product during hosting because of memory and cpu consuption
runtime overhead + tooling overhead + abstraction overhead = slow and slugging experience
JIT always have to recompile everything, always the same things recompiled, over and over, this is a pure waste
not only that but also you can't efficiently use CPU because of cache miss
people always say Java / JVM / JIT is glorious
but reality, and real products show different picture
when people care about that kind of things, the GO compiler only takes 40 seconds to compile
they don't try to find excuses, they show, they don't pretend with theories, facts are there
On my laptop, building the latest version of Go takes only 43 seconds. That includes the compiler, linker, all cross-compilers, and the standard library.
k
@gildor it's funny 😂 You telling java is fast then native language 😂😂😂. Keep your facts with your self, I don't wanna listen and not wanna prove to you.
d
Don't you know what JIT is....?
g
In some cases Java is indeed faster, and if you check how JIT actually works you may understand why it's the case Also, don't forget, of course you can compare Java/JVM directly with C/C++, but obviously Java has huge difference, it's safe, safety comes with performance hit for sure, but this is one of things which you want for 98% of your code. Native doesn't mean fast by default, there is a plenty of native languages, but you comparing very low level C/C++, and there is reason for that, they are indeed fast if done correctly, close to hardware, with all other pros and cons of this. Kotlin Native is a great example, it's slower than JVM version in all cases except startup time There is no single use case or single performance metric
s
should we continue this conversation again for the next 3 years, while we wait we shall keep waiting minutes to recompile single changes to KN projects?
ease of use during development (after long JIT warmup session of course) and then pain to use/consume as user
and you contradict yourself many times
i don't understand why you keep defend JB's choices, it hurts kotlin
people don't care anymore about performance anyways, why i even bother try..
g
What kind choice I defend?
KN compilation slow not because of JVM, but because llvm toolchain is also slow as hell, and yeah, compiler is not optimal too for sure