Hi, there are still no plans to add support for va...
# kotlin-native
s
Hi, there are still no plans to add support for value types ?
g
Yes, there are discussions about this all the time, but in short, value types would be available for K/N only when they will be designed also for other Kotlin platforms: JVM and JS, but it’s to early to do for JVM, because Valhalla is not finalized yet and would be good to have value types as Kotlin language feature compatible with Valhalla implementation
At least this is how I understand current situation with value types
s
value types work the same everywhere, why wait for Java, it'll never come..
data passed by value
and JS has no value types
g
It will come
And introducing big language feature that potentially may be never work with most popular Kotlin platform is not wise
👍 1
and JS has no value types
Yes, but this language feature should be available on JVM and JS, otherwise it would be impossible to use it in common code
👍 1
k
We need a collection of slack threads. I want all the chats about this.
g
Nothing very detailed, just that people from Kotlin team mentioned that they looking into it, but they want to have Valhalla-compatible solution
e
Yes. That is the case. Kotlin’s primary target is JVM. With Valhalla on the horizon we cannot afford to roll out our own solution that would not be compatible with value types on JVM in the future. We need to wait for Valhalla to finalize at lest some of its design for value types to see how we can integrate values types to Kotlin in Valhalla-compatible way.
It does not mean that K/N cannot optimize things. There is a lot of room for K/N-specific optimizations.
(without even language-level changes)