3 ms·
That would be circular, but that's not what the parent is saying. Rather, eta's post has one central point - she even bolds it for us: > Rust is not a language
by NoraCodes 5y ago
That would be circular, but that's not what the parent is saying. Rather, eta's post has one central point - she even bolds it for us:
> Rust is not a language where first-class functions are ergonomic.
And this... I mean, I don't agree with her, but that might be because I've been immersed in Rust for half a decade. But Rust's tradeoffs are based around four things. It is a:
- performant
- reliable (incl. memory safe)
- productive
- systems programming language
"Systems programming language" means no garbage collector. "Reliable" means you can't just pass around references to memory willy-nilly. I'm sure closures and their associated traits (Fn(), "call it as many times as you want", FnMut(), "call it only when certain safety conditions are satisfied", and FnOnce(), "call it once") could have been fine-tuned more, but they _do_ achieve the goal of general, usable (imo) first class functions.
I don't see another design that would have done this.