https://kotlinlang.org logo
#feed
Title
# feed
o

Oleksii

11/13/2017, 3:52 PM
Hey, fellow Kotliners, I have published a new article to hackernoon: https://hackernoon.com/how-kotlin-calamity-devours-your-java-apps-like-cancer-f3ce9500a028 (sorry for too powerful title in advance ;) ) If you like what you see, please give me some medium claps (you can do up to 50) and share it on social media! Feedback is welcome, as well.
👍 2
b

bascarsija

11/13/2017, 6:33 PM
superficial/nit:
There is that fuzz around Android actively adopting Kotlin as a primary programming language.
this might read better as:
There is that buzz around Android actively adopting Kotlin as a primary programming language.
o

Oleksii

11/13/2017, 8:40 PM
@bascarsija thank you! Already fixed this one!
👍 1
v

voddan

11/14/2017, 2:55 PM
Kotlin’s build times are ... about two times slower than Java
Wowowow! That needs evidence and/or correction https://medium.com/keepsafe-engineering/kotlin-vs-java-compilation-speed-e6c174b39b5d
o

Oleksii

11/14/2017, 7:52 PM
Doesn't article confirm my point exactly? First run: kotlin compile about N seconds, Second run: java compile about N seconds plus/minus as well. And you need both compile runs if your app is mixed Java/Kotlin. Hence the 2x speed, no? Or did I misunderstand something?
And the whole article is about feelings of the target audience, not precision and proofs. When I work on web projects with mixed java/kotlin it feels twice as slow on average. Precise numbers are not important when in realm of feelings.
Also, maybe the setup on these past projects was not optimal. Maybe we can avoid doing two compile runs most of the time or at all. If so - please tell me so!
v

voddan

11/15/2017, 4:22 AM
@Oleksii I feel that we use different terminology. What the article calls "first run", aka "cold run", is a clean build of the entire project, including building Java as well as Kotlin code. The "second run", aka "incremental build", is building the project without deleting previously compiled class files, again, both Java and Kotlin included.
And you need both compile runs if your app is mixed Java/Kotlin
I think Kotlin compilation times already include compiling the Java, e.i. those N seconds are already javac+kotlinc+javac for clean builds. For incremental builds the system is smart enough to mitigate the overhead completely.
o

Oleksii

11/15/2017, 5:48 AM
So what you are trying to tell me is that properly configured kotlin project should compile as fast as Java. Could it be that we've experienced slow compiler start in the past. Like in: compile time is quick but compiler takes a few seconds to start when running tests in intellij. Do you know if that is common misconfiguration? In these particular projects we were just adding
apply plugin: "kotlin"
to our Gradle file together with kotlin-spring and kotlin-autoopen plugins. We added compile dependency for Kotlin stdlib and Kotlin reflect lib. Anything rings the bell?
@voddan I’ve fixed it to read “Moreover, Kotlin’s build times are extremely fast. It can be even faster than Java if you have incremental compilation enabled!”
v

voddan

11/16/2017, 5:22 AM
@Oleksii 👍 doesn't it sounds more optimistic than before? 😛
o

Oleksii

11/16/2017, 9:55 AM
It does. I'll still have to figure out how to set it up properly on my next project. ;)
5 Views