2 ms·
> If ranges are immutable, referentially transparent, those problems go away. Do they though? Ultimately you need to store them somewhere. And oh look where we
by sillysaurusx 5y ago
> If ranges are immutable, referentially transparent, those problems go away.
Do they though? Ultimately you need to store them somewhere. And oh look where we’re headed, choo choo last stop ownership semanticsville.
Though it would be interesting to just yeet it into the global static ether and leave it at that. I wonder if such a thing would’ve been possible in rust. It’s kind of funny when you think about it, that all this fuss is just to track two integers aka 16 bytes.
Still, at that point it wouldn’t be be a “global static” pool so much as a global pool.
- lalaithion 5y agoYou could make Range<T> copy if T is copy, which would tell the compiler “feel free to automatically copy this, move it into registers, or put it on the stack”, which basically makes it usable as a “value type” with no ownership semantics.
- sillysaurusx 5y agoCan you? If so, what’s the point of this article? Something doesn’t add up.
- lalaithion 5y agoSorry, the “you” in the article isn’t referring to what an individual rust programmer could do, but what the rust language designers could do.