Rust should have stable tail calls(trifectatech.org) |
Rust should have stable tail calls(trifectatech.org) |
Back then Rust's tail call story looked bad. The problem slipped my mind for years and now I'm suddenly made aware of this become keyword, and it seems like a great idea -- to make the developer's intent more explicit. Getting better target support for this is doing god's work.
As an aside, I would slightly argue against the idea that it's useful only for a narrow set of libraries. It's useful for the developer as a user of the language to be able to express things in either iterative or recursive style without worrying as much whether the latter is going to panic. Maybe if I had to deal with all the work of making such features functional in a language, I would value expressiveness a bit less!