The value will be evaluation at runtime, but it's ...
# announcements
i
The value will be evaluation at runtime, but it's immutable.
d
I'm not sure if this is what you are looking for.
that is for immutable collection, depending on what immutable data type you actually need
i
😅not a collection. I'm finding a language level feature that can decorate a value which is evaluation at runtime but immutable.(
Looks Kotlin haven't
d
yea.. i don't think so... what are you trying to achieve anyway actually? maybe it can give better idea to us as well..
i
Only a think. If a language has this feature, does the compiler will be more extreme on optimization?
Such as String.length is evaluation at runtime, but it's immutable because String is immutable.
d
Yep, from what I understand, immutability does help with compiler optimisation.
t
if you are worried about runtime performance that can be optimized out of immutable aggressive compilation, jvm has the jit compiler, optimization will be performed while your application is running based on runtime behavior. I never really dug much into the topic (not writing performance critical application myself) and saw few presentation describing the mistakes of jit (which are quite funny), but was there since the beginning, it is probably pretty much optimized itself
💯 2