4 ms·
I'm puzzled why Kotlin isn't getting enough attention on HN, at least as much as Rust or Zig. Kotlin is indeed popular in it's specific domain (Android & Java)
by lewisjoe 3y ago
I'm puzzled why Kotlin isn't getting enough attention on HN, at least as much as Rust or Zig.
Kotlin is indeed popular in it's specific domain (Android & Java). But the company is keen to position it as "write once run anywhere" space with a strong focus on multiplatform development.
1. The build system provides platform specific bindings for free (huge plus compared to the hassle of writing the core in C/C++ and then hand-writing platform specific bindings)
2. Keen focus on enabling single codebase for multiple platforms.
3. The company went so far, as to build a multi-platform UI Framework (Compose Multiplatform) that directly renders to Skia and runs on all mobile/desktop platforms. And even on browsers (with wasm)
I find it odd, that such interesting a language / compiler finds little attention beyond its domain.
Is there any reasons for this that I'm missing?
- dickersnoodle 3y agoiOS dev here. What you're missing is that a ton of native-code developers (me included) aren't interested in adopting an abstraction layer that has to be tweaked to approximate the look and feel of the native OS UI layer when we could just built it natively to begin with and save all that effort. We've seen PhoneGap/Cordova, we've seen React Native and we'll keep seeing money thrown away on pretending that there aren't real platform differences when there are.
- frizlab 3y agoThis. It’s exactly the same for me (also iOS dev, and I do Swift on the server too).
- mike_hearn 3y agoThe idea is you can write SwiftUI on iOS, whilst connecting to business logic written in Kotlin.
- medo-bear 3y agoim not a phone app dev, but im curious, cant you already write backend code in another language and the ui in swift
- azarovalex 3y agoBusiness logic is not only about backend. Apps usually have a lot of client-side logic that can be written once in KMM and used on both platforms. See [1] for a high level architecture diagram. I'm an iOS dev and I've been using KMM on a couple of projects for more than a year now. It's really a powerfull technology which allows teams to move faster, but there are downsides, for example lack of native Swift interop, though there are opensource tools trying to solve this [2]. [1]: https://github.com/Kotlin/kmm-production-sample/tree/master#architecture https://github.com/Kotlin/kmm-production-sample/tree/master#... [2]: https://github.com/touchlab/SKIE https://github.com/touchlab/SKIE
- dickersnoodle 3y agoSort of but not really. SwiftUI is reactive, with view changes triggered by changes in Swift variables and those changes triggered using Combine. The later iterations of Swift include async/await to greatly simplify async code (normally but not always focused on network endpoints). You can write everything you need without having to drag Kotlin into the mix, and including Kotlin will require bridge code that seems (to me, at least) an unwanted obligation just to let some executive say "We saved some money by sharing code!".
- whoopsie 3y agoNo no no. Just look at the janky stuff one needs to do to compile Kotlin for an iOS project. Plus, object lifetime semantics differ. Now you won’t be able to write Kotlin native code without thinking of iOS rules. So now you have the worst of unfamiliar worlds with a “most fast” product speed.
- Larrikin 3y agoAs an Android developer that's been using Compose and multiplatform I believe the play is to get Android developers to be able to minimally adapt their apps to run on iOS. They don't pretend that you don't need to know anything about iOS but are trying to abstract as much (or as little) a way to compile to both. The other multiplatform attempts failed because they were trying to use languages that neither side wanted or knew and pretended like you could drop in a dev from a completely different field and not need to know much about the platforms. If you did know the platform you were fighting against the framework in an unfamiliar language. That said it is definitely not there yet, but I hope they get it to a reasonable place. I've enjoyed Android development and would love to be able to more simply port over a project without a complete rewrite.
- evereverever 3y agoStack traces look like garbage though. I've developed a library for KMM. The iOS devs didn't want to touch it, so write once, make android devs keep it up. Also it was the network layer, so that's the easiest shit to write natively.
- MarkMarine 3y agoI think modern Java has stolen a lot of Kotlin’s thunder. The differences between the languages shrink with each Java release, and server side Kotlin isn’t evangelized by its main cheerleader, google. It’s a GC language, so rust/zig are not good comps. Go, Java, Scala, Server side JS/Node, or python. These are the comps. Personally, I’ve written a number of non-trivial, server side applications in Kotlin. The extra cost of asking my colleagues to learn another language and some pain in the interop with Java has dampened adoption. It’s a shame, I find the coroutine library a joy to use, with none of the painful drawbacks of go, node, python, etc.
- colanderman 3y agoDon't forget C#/F#. Microsoft's been leaning hard into cross-platform with MAUI.
- callalex 3y ago[flagged]
- h4x0rr 3y agoHot take: Microsoft can't do good UI frameworks and it shows. XAML makes some things really hard, resulting in loads of ValueConverters for example. Part of my bad experience might just be the learning curve but honestly I'm not surprised so much software is built using Electron.
- colanderman 3y agoI am actually using Avalonia+ReactiveUI for my current project (MAUI doesn't support Linux or F# last I checked), which I understand is similar to WPF... what a hot mess it is to wire up models to views in just the right way, especially in F#.
- Clamchop 3y agoThese are all fair points for Java on the JVM or Android, but Kotlin Multiplatform does things that are well beyond the purview of the JCP. It has downsides to be sure but it's not as simple as evaluating it as just another option for compiling to bytecode anymore.
- deleted 3y ago[deleted]
- sakex 3y agoI use Kotlin daily at my job (I have to) and I'm not impressed. It is a new language that ignores most of the innovations in Programming Language Theory from the last 20 years. It only improves on Java by making the syntax less verbose and adding coroutines but almost doesn't add any benefits in terms of semantics.
- osdev 3y agoHi, I’m curious, can you elaborate on the language features that you think Kotlin ignores?
- wiseowise 3y ago> It is a new language that ignores most of the innovations in Programming Language Theory from the last 20 years. Such as?
- brokenbyclouds 3y agoIt's ok everyone, they must misspelled Go as Kotlin
- Clamchop 3y agoI'd really, genuinely be interested in reading more about this theory, and what your criticisms of kotlin are. No, really, I'm interested!
- mu53 3y agoIts trying to be everything, but its good at nothing. Even with spring boot, it has a painful edges. Learning a language isn't a huge burden. Frameworks and libraries can alleviate huge burdens. Kotlin avoids the benefits of frameworks and libraries while giving meager benefits in term of language constructs.
- sierisimo 3y agoCan you elaborate on the painful edges and the benefits of frameworks avoided? I wanna understand better as I do kotlin in daily basis, some with spring, some with ktor and some with android and I don't get your points.
- SpaghettiCthulu 3y ago`kotlinc-native` is one of the slowest compilers out there. Try compiling a "Hello, World!" program. It's slower than `rustc`. By a lot.