3 ms·
> Try working with lazy immutable data structures in Rust. I don’t think this is that hard; you “just” need to construct the data structures as elements of an
by derefr 7y ago
> Try working with lazy immutable data structures in Rust.
I don’t think this is that hard; you “just” need to construct the data structures as elements of an object-graph data structure, and then retrieve your data through an explicit thunk of the object-graph itself.
In lazy languages the object-graph data structure is implicit, but that doesn’t mean that the Rust version of the call site code needs to be any more verbose. It’s just the definitions of the data structures themselves that would be more unwieldy. (And you could probably build some generic lazy container types and mostly work with those.)
Think: what Objective-C does with autorelease-pool objects.