News for hackers. Stuff that matters.
Re:Go 1.18 by yawaramin on Tuesday March 15, 2022 @07:39PM (#30693403)
Rust isn't a functional programming language. You could try OCaml, it's kind of a halfway point between Go and Haskell.
Re:Go 1.18 by int_19h on Tuesday March 15, 2022 @10:12PM (#30694490)
Rust has first-class functions. Not only that, but it also has immutability by default, and ADTs with pattern matching. If OCaml is functional, why wouldn't Rust be?
Re:Go 1.18 by chombier on Wednesday March 16, 2022 @05:03AM (#30696687)
Because of lifetime of captured variables in closures, mostly.

You can't really pass around functions freely like you would in Haskell/ML unless you start Box-ing/Rc-ing everything. But then it's not really idiomatic Rust anymore, IIUC.

Re:Go 1.18 by lmm on Wednesday March 16, 2022 @06:08AM (#30697026)
Rust doesn't really have first-class functions - you can't take an arbitrary snippet of code and turn it into a function value, because sometimes it will no longer pass the borrow checker.
Re:Go 1.18 by yawaramin on Wednesday March 16, 2022 @11:59PM (#30707517)
Well, one big one is lack of tail call elimination. If you can't write even a simple tail-recursive algorithm in the language, it's not a functional programming language.