News for hackers. Stuff that matters.
Re:Why Rust closures are somewhat hard by virgilp on Monday September 10, 2018 @04:01PM (#17954712)
... and there's ample evidence that this is a reasonable assumption, so let's do closures based on it, too! :)
Re:Why Rust closures are somewhat hard by geezerjay on Monday September 10, 2018 @05:49PM (#17955513)
> ... and there's ample evidence that this is a reasonable assumption

Actually, there is. C might be a colossal footgun but reasonably experienced developers do manage to avoid those problems.

Re:Why Rust closures are somewhat hard by virgilp on Tuesday September 11, 2018 @02:26PM (#17962113)
I'd like to see that ample evidence. On the contrary, I know even fairly experienced developers who get burned with memory issues in C - and I have never ever heard of even the most junior developer to have any problem with double frees in Java :)

Plus..... even if you could do that, WHY? C is a simple language, close to the "metal". If you want a language that has every-feature-and-their-mother, and can be close to the metal when needed, and can be used to blow both your feet off, just use C++.

Adding functional closures to C is somewhat akin to adding "asm" and "volatile" in Haskell.... even if you could do it, why would you? It just breaks the very essence of the language.

Re:Why Rust closures are somewhat hard by bonzini on Monday September 10, 2018 @04:20PM (#17954864)
Well, that's what C++ lambdas do. Though C++ has smart pointers to help with lifetime issues.