Re:Cursed Linear Types in Rust
by cempaka on Sunday December 01, 2024 @03:20PM
(#42290470)
And Java will soon have StableValue: https://openjdk.org/jeps/8312611
[ Parent
| on HN ]
Re:Cursed Linear Types in Rust
by neonsunset on Sunday December 01, 2024 @04:29PM
(#42290860)
Reading the JEP, isn’t StableValue about JIT constants?
In .NET it’s just 'static readonly'.
The basic feature set is at-most-once thread-safe initialization of values, which can then enjoy the same constant folding and other JIT optimizations one would get from `static final`, but can be initialized at any point during the program's run.
Non-goals
It is not a goal to provide Java language support for declaring stable values.
HmmmFrom context, I would infer that this means they are not changing the Java language itself. It’s a feature expressed through the existing language, like as a library feature. I could be wrong though.