News for hackers. Stuff that matters.
Re:Functional programming is finally going mainstream by ch4s3 on Tuesday July 12, 2022 @11:00PM (#32078573)
Immutable data structures often don’t copy a lot of data around. Immutable linked lists have tail references from each head. If something falls out of scope it gets collected by the garbage collector. Also if you don’t share memory between processes, you can free that memory once a process terminates, which may seem orthogonal but it’s a core principle in Erlang.
Re:Functional programming is finally going mainstream by yencabulator on Wednesday July 13, 2022 @01:46PM (#32086204)
Those copy-on-write linked data structures, with the implied pointer chasing, have a cost. That's what the parent is talking about...
Re:Functional programming is finally going mainstream by ch4s3 on Wednesday July 13, 2022 @02:54PM (#32087185)
A lot of languages, like Erlang/BEAM, use pointers under the hood and aren't necessarily copying anything.