Kotlin running on the JVM is a disadvantage outside of Android though in a lot of spaces. Rust/Swift/Go will use a fraction of the ram to run a server application than Kotlin will.
One big potential pitfall people seldom discuss is that Java is moving in a different direction and taking JVM along with it. This will cause problems in the future for Kotlin in areas such as reification and nullability.
Kotlin compiles to the native architecture on non-JVM targets. It works just as well as using Swift on non-Apple targets, that is to say it's a bit of a pain development-wise but runs fine once you have your tool chain and interop code setup. Honestly versus either, I'd recommend dart/flutter. Insanely productive, native compiled code, performant UIs that reasonably emulate native (although I'd recommend avoiding that and going stylized - users are more willing to accept something different than something close but not quite right). And interop with C++ is pretty easy.
Flutter is trash (slow and ugly) built on a dead end language (dart).
Any company building their business on flutter is setting themselves up for disaster and an expensive double-rewrite to native, while having a useless engineering team because they skilled up previously mentioned dead-end.
the article displays a couple of screenshots on why it's a poor experience, bottom navigation is to small and the back button is behind the camera, it's very unlikely to be fixed at the component level so devs end fixing these issues themselves by creating a new component that may not behave entirely as the system one, using the device's safe area
I don’t see the same issues you mentioned when checking the screenshots on their App Store / Play Store pages. But that was a good catch of yours.
I’m relatively confident that they used a device frame around their actual screenshots, which leads back to those issues you mentioned. You can tell that they’ve used different device frames in their current store listings compared to the realistic looking ones on the aforementioned Flutter showcase page.
This whole process can even be automated. I’m talking about a CI/CD workflow that takes screenshots of specific pages, and adding device frames around them etc. See this tool for example: https://docs.fastlane.tools/actions/frameit/
So if Kotlin targets two completely seperate platforms (JVM and native) does that mean any C++ interop would have to be written seperately and differently for each of those platforms?
This is correct but not because of Java. The android SDK is terrible because of many reasons.
Which is also the reason why kotlin is so popular there. Using extensions function and concise syntax you can build clutches around this terrible abomination of an SDK.
Exactly right. It seems difficult for so many folks to understand Kotlin is not some independent language from scratch but another JVM language trying to avoid Java's supposedly shortcomings. And Kotlin/Native/Web doesn't matter because core language design is simply informed by Java and other JVM ecosystem languages' features and limitations.
I think Kotlin is newer/better horse cart to Java's old cart rather than automobile.
Further as others have mentioned Java's 6 month release cycle and ton of changes at language/VM/library layers will make it difficult for Kotlin to choose between complying to latest JVM or chart an independent path.
I agree, a huge driver for me leaving the Java ecosystem for Go was the JVM. Maybe Kotlin native can address that, but despite what people in the Java world seem to believe, the JVM is a big disadvantage.
The JVM may be full of technology that’s indistinguishable from magic, but deployment is a pain in the ass.
Maybe things have changed in the last few years but - having to ship a huge file tree alongside the actual binary (or binaries because JARs are also a nightmare), and the slow startup time due to the need to interpret/compile bytecode instead of just running machine code, make Java really unpleasant to use in many common use cases.
Well I shipped fat jars using capsule more than 15 years ago without any issues. Nobody ships file-trees.
Also the Startup depends on how much memory you allocate, but much of it is due to verifying class security, a feature that other runtimes don't even have. Or badly used reflection, another feature others don't have.
In any case I really never found it an issue if a server takes 3 seconds to start and I never understood why people complained about Java startup. My guess is they complain about clunky desktop application with a million classes written in it.
Regarding the bytecode: the interpretation and just in time recompilation gives Java sometimes better than native performance.
It also allows you to hook into the code on the fly and transform it with agents. Can native do that?
The file tree I was referring to is the JRE, not the code.
In any case, if Java works for you then that’s great. I’m just relating my own experience, where I found that the need for a JVM was less of a blessing than a curse.
As a former C developer who has been using Java for 20+ years, moving to Go was like lifting a weight off my shoulders. (I suspect I’d have felt the same with Rust, Swift or any other modern AOT language). It’s so refreshing to just have a binary, and be able to execute it, and not worry about a pile of irrelevant external factors.
The JVM uses as much RAM as you allocate in your program. If you get along with 4 megabytes then you can set the maximum memory of the JVM to 4 megabytes and it will never use more than that.