[HN Gopher] The Hitchhiker's Guide to Kotlin
       ___________________________________________________________________
        
       The Hitchhiker's Guide to Kotlin
        
       Author : minnca
       Score  : 28 points
       Date   : 2021-09-21 20:58 UTC (2 hours ago)
        
 (HTM) web link (nathan-contino.github.io)
 (TXT) w3m dump (nathan-contino.github.io)
        
       | nassimsoftware wrote:
       | Kotlin is a really nice language. I wish it was used more
       | especially that now it isn't just limited to the Android and Java
       | ecosystems.
       | 
       | Kotlin can now compile to native binaries :
       | https://kotlinlang.org/docs/native-overview.html#sharing-cod...
       | 
       | Kotlin can now compile to Javascript :
       | https://kotlinlang.org/docs/js-overview.html Edit : You can even
       | use React with Kotlin : https://kotlinlang.org/docs/js-get-
       | started.html
       | 
       | Kotlin can now be used for datascience as well (You can run
       | kotlin code in a jupyter notebook) :
       | https://kotlinlang.org/docs/data-science-overview.html#libra...
        
         | vips7L wrote:
         | Does kotlin native have a std lib yet? Last I checked you
         | couldn't even read a file.
        
         | pjmlp wrote:
         | Kotlin/Native is hardly a stable target, given that they
         | botched the implementation by going with an incompatible memory
         | model as Java, and have spent the last year fixing it by
         | rebooting it with a proper GC implementation.
         | 
         | Hardly any better than just using GraalVM or any other JVM AOT
         | compiler, some of which go back to early 2000's even if only
         | available in commercial JDKs.
         | 
         | The JavaScript compilation target still needs to do some
         | catching up with TypeScript.
        
           | nassimsoftware wrote:
           | What catching up is required compared to TypeScript? Could
           | you go in bit more details on that, I'm curious.
        
             | pjmlp wrote:
             | Ecosystem, tooling, libraries.
        
               | smallerfish wrote:
               | It's actually very good - debugging from the IDE now even
               | works. I'd recommend building around KVision rather than
               | raw KotlinJs (https://kvision.gitbook.io/kvision-guide/).
               | 
               | The main thing that can be annoying is figuring out
               | module exports from a js library that you want to use
               | (which is probably easy enough if you have a modern
               | javascript background). I haven't found a library that's
               | stumped me yet, but some are more annoying than others.
               | Jetbrains have a tool called Dukat which will supposedly
               | one day automate this, but for now it's not there.
               | 
               | Distribution size can be an issue, but it's not terrible.
               | My current (moderately complex) app is floating at around
               | 2MB. I haven't tried splitting it up, though that is
               | possible.
        
           | erpellan wrote:
           | I feel the non-JVM targets are a real distraction from what
           | is a lovely language. I'd rather they focussed more on fixing
           | the issues with kotlin in IntelliJ - you'd think controlling
           | both the language and the IDE would result in a less buggy
           | experience than the current situation.
        
             | pjmlp wrote:
             | I agree, to me it feels just like JetBrains turned Borland
             | just before the Inprise Corporation makeover.
        
         | ParanoidShroom wrote:
         | I do kotlin daily, almost exclusively including side projects.
         | 
         | Kotlin native has been rocky personally, I'll check back in a
         | year.
         | 
         | Kotlin on Android is a must compared to Java, else you're a
         | fool. Haven't seen any exceptions in the industry.
         | 
         | Kotless is okay, works, but early days.
         | 
         | I've seen decent backends on quarkus and kotlin.
         | 
         | It's a fun language, the couroutine development is pretty nice.
         | Flow is a lot easier than Rxjava.
        
       | smackeyacky wrote:
       | Has anybody switched to mixing in Kotlin code within an existing
       | Java Android app? I'm not a huge fan of Java but I don't know
       | whether it will be too jarring for maintenance tasks if I have
       | both languages as code. There is a lot of XML floating around in
       | my app (as most Android apps have) but switching between editing
       | that and the Java is fine.
       | 
       | I'm keen on the idea that there would be less code and my app is
       | getting a little creaky and could use a refresh, but does Kotlin
       | make the boring stuff easier? Things like inflating classes from
       | REST json calls, interacting with the SQLite database.
       | 
       | How does it do on the more "exciting" (ahem) parts of Android
       | like Bluetooth? I lean heavily on RxAndroidBLE to cope with the
       | rubbish bluetooth stack and I think the code around that could do
       | with being simplified.
        
         | pjmlp wrote:
         | On Android, it is kind of clear, Google is doubling down on
         | Kotlin and the team is hardly motivated to move Android Java
         | into proper Java, so long term Kotlin seems to be the only path
         | forward.
         | 
         | Still cherry picking features from Java 11 when Java 17 just
         | got released, https://android-
         | review.googlesource.com/q/project:platform%2...
        
           | smackeyacky wrote:
           | Oh really? Is this still a hangover from the Oracle lawsuit
           | stuff?
           | 
           | I might give it a whirl and start replacing the easy stuff
           | first. In my system the worst part is the Android app and
           | anything that makes it easier to maintain in the long term is
           | welcome.
           | 
           | edit: Not sure how I missed this announcement:
           | https://www.zdnet.com/article/google-were-using-kotlin-
           | progr...
        
             | pjmlp wrote:
             | Oracle has nothing to do with it, given that Kotlin and
             | Android Studio are fully dependent on the JVM ecosystem.
             | 
             | If that was the reason Dart would have been a better
             | option, but I bet the Android team is not that keen on
             | having Fuchsia take away their party, hence JetPack
             | Composer.
        
       ___________________________________________________________________
       (page generated 2021-09-21 23:00 UTC)