News for hackers. Stuff that matters.
Re:Go proposal: new package to provide generic slice functions by iudqnolq on Wednesday May 05, 2021 @01:55PM (#27053263)
I generally agree with you, but it's nice that in Rust you can use a for loop if it makes more sense. I mostly end up doing this when I want to reduce to multiple collections (put type a in here, type b in there) or call functions that return different types of errors.

The other time it's very useful is when translating algorithms specified in an imperative form. I translated a bunch of algorithms specified as for loops to elixir, and it was annoying to have an extra source of complexity when comparing the implementations for correctness.

Re:Go proposal: new package to provide generic slice functions by jolux on Thursday May 06, 2021 @11:44AM (#27064978)
It’s definitely nice to have the imperative constructs but spending a lot of time with pure languages has changed my perspective on mutability. I think Rust mostly fits it, data is immutable by default in Rust.