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 `…
Kotlin 1.2 Released: Sharing Code Between Platforms
21–30 of 41 posts
Re: Kotlin 1.2 Released: Sharing Code Between Platforms
#22Earlier 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).
Re: Kotlin 1.2 Released: Sharing Code Between Platforms
#23Earlier 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.
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
#24> "Working with the Command Line Compiler" https://kotlinlang.org/docs/tutorials/command-line.html > "We can download it from GitHub Releases." https://github.com/JetBrains/kotlin/releases/tag/v1.2 404
Re: Kotlin 1.2 Released: Sharing Code Between Platforms
#25I 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.
Re: Kotlin 1.2 Released: Sharing Code Between Platforms
#26Earlier 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.
Kotlin has gotten official support from Google, including documentation as part of Android SDK.
Re: Kotlin 1.2 Released: Sharing Code Between Platforms
#27Eclipse 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.
Re: Kotlin 1.2 Released: Sharing Code Between Platforms
#28Earlier 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.
Re: Kotlin 1.2 Released: Sharing Code Between Platforms
#29Re: Kotlin 1.2 Released: Sharing Code Between Platforms
#30Earlier 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.