News for hackers. Stuff that matters.
Re:The borrowchecker is what I like the least about Rust by zozbot234 on Sunday July 20, 2025 @01:38AM (#44622276)
> Idiomatic programming in a functional language requires garbage collection.

Rust has functional programming features and no garbage collection, because the borrow checker can tell when a closure will outlive the references in its captured environment. We used to think that would not be feasible other than perhaps in very special cases - hence the need for GC to keep that environment around - but Rust proved that wrong quite convincingly.

Re:The borrowchecker is what I like the least about Rust by amelius on Sunday July 20, 2025 @05:59AM (#44623520)
"Having FP features" does not mean "allow an idiomatic FP programming style". If this were the case, we'd be seeing a revolution in functional programming now. It's not like the FP community is slow to adopt good ideas. In fact, many innovations that lead to the invention of the borrow checker came from the functional programming world (linear, affine types, effect systems).
Re:The borrowchecker is what I like the least about Rust by zozbot234 on Sunday July 20, 2025 @06:33AM (#44623740)
What's an "idiomatic FP programming style"? Is typical LISP code "FP" enough? That uses GC of course, but other than that it's often high-level enough to be quite comparable w/ modern Rust.