https://kotlinlang.org logo
#getting-started
Title
# getting-started
u

ursus

10/09/2023, 11:23 PM
One thing that makes Swift is value semantics Are there any plans of adding this to the language? I presume real value types are a pipedream since jvm doesnt care, but the var semantics is way nicer code than
.copy
so maybe just the syntax as a sugar?
there is some hope for future JVMs, https://jdk.java.net/valhalla/ but it's not ready yet
u

ursus

10/09/2023, 11:46 PM
soo nothing until valhalla?
realistically speaking
I'd gladly accept it just as a sugar for copy
btw do you have any info as on what big is coming next other than the new compiler? which sure is great for performance, but not really a language feature, is it
r

Riccardo Lippolis

10/10/2023, 5:09 AM
The main focus is on K2 right now, which will also bring some advantages language-wise. You can see what is being worked on in the roadmap: https://kotlinlang.org/docs/roadmap.html
e

ephemient

10/10/2023, 5:27 AM
to clarify, the Kotlin language is not changing with 2.0 (aside from minor fixes), only the Kotlin compiler implementation changing to K2
👍 2
https://blog.jetbrains.com/kotlin/2023/02/k2-kotlin-2-0/
We are consciously avoiding introducing any new features in Kotlin 2.0.
w

Wout Werkman

10/10/2023, 8:21 AM
Kotlin's multi-field value classes do not strictly depend on Valhala. You can follow the progress in KT-1179.
I'd gladly accept it just as a sugar for copy
While there are no compiler plugins that get your desired semantics via
var
, there are some cool compiler plugins to make working with immutable data more pleasant. https://arrow-kt.io/learn/immutable-data/intro/