2 ms·
> Finally Kotlin/Native has special semantics for handling data structures, as it tries to be Swift like If you mean Swift's issue with having to use weak refe
by ptx 7y ago
> Finally Kotlin/Native has special semantics for handling data structures, as it tries to be Swift like
If you mean Swift's issue with having to use weak references to prevent cycles, Kotlin/Native doesn't do that – they have a cycle collector, so it should behave the same as Kotlin/JVM.
It does have a different threading model though, where you can't share mutable structures between threads. Very recently they've introduced a "relaxed" mode that does allow it, but it's extremely experimental and sounds like it would be slow (since it can't defer updating reference counts).
(Also, what are you referring to with "extra debugging layers, tooling and their own wrappers" for Kotlin on the JVM? I can use IntelliJ + Maven + Spring with either Java or Kotlin. I don't see any extra layers.)
- pjmlp 7y agoYep, I mean the semantic model for data structures. Try to call idiomatic Kotlin code from Java and see how it looks like. Specially when co-routines and similar higher level constructs get added, or having to deal with compatibility between Java streams and Kotlin sequences, which don't build on top of Java ones. When Loom arrives, it will be a similar story, Java proper fibers and Kotlin co-routines and how they might interoperate. Nothing unique to Kotlin per se, all guest languages happen to have similar bumps. Calling Scala or Clojure from Java leads to similar lists. Then one is required to buy into JetBrains tooling for Kotlin, and get an additional license for Clion as means to have a graphical debugger for Kotlin/Native. There is an Eclipse plug-in, which is kind of 2nd tier, and none at all for Netbeans. With Java it is just ready set go, no matter which IDE, with just one IDE for Java and native, alongside mixed mode debugging (a feature JetBrains doesn't see a value supporting) and not all Java shops are into InteliJ idolatry.