Live data from Hacker News

Kotlin 1.2 Released: Sharing Code Between Platforms

blog.jetbrains.com

21–30 of 41 posts

Re: Kotlin 1.2 Released: Sharing Code Between Platforms

#21

Multiplatform docs here: https://kotlinlang.org/docs/reference/multiplatform.html Example from the docs: // Common module package org.jetbrains.foo expect class Foo(bar: String) { fun frob() } fun main(args: Array ) { Foo("Hello").frob() } // JVM module package org.jetbrains.foo actual class Foo actual constructor(val bar: String) { actual fun frob() { println("Frobbing the $bar") } } I brought up how I thought the `…

that is so verbose I still can't believe it's true. sorry actually true

Re: Kotlin 1.2 Released: Sharing Code Between Platforms

#22
post #19

Earlier quoted context omitted.

If I can't reuse code between iOS & Android then what is the benefit of using Kotlin over just building mobile apps in Java & Swift?

You can't reuse UI code between iOS and Android. You do have the ability to reuse the business logic code (domain models and so on).

Great idea , but for many react apps (both native and JS) domain models doesn’t exists. Redux + graphql apps let me eliminate even more logic. So what we actually share between react native and react JS apps are : graphql queries, reducers, saga middleware. The rest is just UI. In my usecases there is nothing to share using Kotlin.

Re: Kotlin 1.2 Released: Sharing Code Between Platforms

#23
post #4
post #3

Earlier quoted context omitted.

You are not alone. I also believe they could have manage it without polluting the code with expect and actual. Probably the compiler would need some extra work to do the matching.

True, but on a scale of 1 to 10, with 10 being amazing, Kotlin is quite high, maybe an 8, and your point is only a minor nit.

You seem very fond of Kotlin.

I hear a quite a bit about it lately, but as I haven't had the chance to play with it yet, I was wondering why would one choose it over Scala.

Re: Kotlin 1.2 Released: Sharing Code Between Platforms

#26
post #23
post #4

Earlier quoted context omitted.

True, but on a scale of 1 to 10, with 10 being amazing, Kotlin is quite high, maybe an 8, and your point is only a minor nit.

You seem very fond of Kotlin. I hear a quite a bit about it lately, but as I haven't had the chance to play with it yet, I was wondering why would one choose it over Scala.

When doing Android development.

Kotlin has gotten official support from Google, including documentation as part of Android SDK.

Re: Kotlin 1.2 Released: Sharing Code Between Platforms

#27
post #25

Eclipse plugin is stuck on 1.1.1, 20 March 2017. I understand JetBrains would like everyone to use InteliJ and they aren't required to support other IDEs, but it prevents adoption on many IT departments that only allow for Eclipse on their dev images.

We're now resuming the development of the Eclipse plugin, and you'll see new updates very soon.

Re: Kotlin 1.2 Released: Sharing Code Between Platforms

#28
post #18
post #10

Earlier quoted context omitted.

We've fixed this already; the fix is being deployed. The correct URL is https://github.com/JetBrains/kotlin/releases/tag/v1.2.0

$ which kotlinc /opt/src/kotlin-1.2.0/bin/kotlinc $ kotlinc /usr/bin/env: ‘bash\r’: No such file or directory Seems to have been saved with MS Win line ends, which causes a problem with bash on Ubuntu.

Yes, we have an issue in our issue tracker for that already; will fix in the next update. Sorry!

Re: Kotlin 1.2 Released: Sharing Code Between Platforms

#29
I really hope this release means https://github.com/JetBrains/kotlin-native will get brought onto the express lane! It's either Kotlin or Swift that will go full cross platform for end user applications (JS/Android/iOS) and Kotlin right now has the advantage! (Swift doesn't officially support the Web story.)

Re: Kotlin 1.2 Released: Sharing Code Between Platforms

#30
post #23
post #4

Earlier quoted context omitted.

True, but on a scale of 1 to 10, with 10 being amazing, Kotlin is quite high, maybe an 8, and your point is only a minor nit.

You seem very fond of Kotlin. I hear a quite a bit about it lately, but as I haven't had the chance to play with it yet, I was wondering why would one choose it over Scala.

I find it to be more pragmatic and easier on the eyes. It's easier to learn and also being adopted by more mainstream ecosystems like Spring, Android, Gradle, etc. IDE support is obviously top-notch as well.
Post reply on HN