Can anyone explain current caveats and/or limitations with current licensing?
Can anyone explain current caveats and/or limitations with current licensing?
You can pretty much ignore the FUD posts about Java licensing. There are long winded replies to why it is FUD, but the short answer is it is trivially not a problem. It only applies if you use the Oracle JDK and want a certain type of support. Most of the world doesn't, instead using one of the other free JDKs.
Java is *not* popular in the reddit, HN, etc memesphere. In the real world it remains incredibly popular and a huge number of organisations continue to pick it as their language of choice for back-end development.
So yeah, Java is insanely popular (top 3 language, among JS and Python, only their orders change depending on sane metrics (not you tiobe)), and is completely free with multiple vendors. Also, it’s pretty bullshit to consider Oracle any worse than other companies - they are the ones who completely opensourced OpenJDK and are responsible for 95+% of all the commits.
Android switched to it as the default as well.
They seem to be attempting to move away from the JVM, preferring it's own multiplatform native compilation which is significantly less battle tested and, last I checked, still suffers from serious performance issues. This is a shame too because Oracle has put a lot into the development of GraalVM, which is a great solution for native compilation of JVM languages, but Kotlin still wants to tread it's own path for some reason. It creates a weird fracture in the ecosystem where some libraries only support either multiplatform or the JVM, and I'm pretty sure Java can't even be used in multiplatform projects.
Another big issue is that idiomatic Java code can often feel clumsy to use from Kotlin: for instance Kotlin function types don't map nicely to functional interfaces and the syntax for AutoClosable/try-with-resource statements is awkward. I can only see this getting worse in the future, as Java continues to develop new features and standard library APIs that are designed FOR JAVA. An example of this already happening is Java's in preview structured concurrency API. It makes heavy use of try-with-resource and offers duplicate but not necessarily compatible functionality to Kotlin's own coroutine API.
Also build times... They have gotten better but they are still much worse that any plain Java project and Java build times are already not great.
Calling Java code from Kotlin may not always be 100% idiomatic but it's still by far the best interop between two different languages that I've ever seen (compare that e.g. to Scala). The interop is more than good enough to be viable for a migration scenario where old stuff is written in Java and new things are written in Kotlin - I definitely wouldn't recommend keeping writing both new Java and new Kotlin code, though.
Build times can be an issue (though hopefully improved with the new compiler), but incremental compilation helps (something that maven unfortunately sucks at, so it's better to use gradle). And in any case, the compiler does more (useful) work in Kotlin, so I think it's ok that it takes a bit longer.
Kotlin styles also differ considerably unlike Java which is far more uniform in comparison.
Threads like the below are surprisingly common even after several improvements in recent years.
https://discuss.kotlinlang.org/t/compiling-kotlin-is-x100-sl...