News for hackers. Stuff that matters.
Re:A philosophical difference between Haskell and Lisp (2015) by klipt on Sunday August 02, 2020 @11:34PM (#24033977)
Right, but couldn't the same thing happen with Unix pipes if the components write to a global file?

You can do the same optimization Unix pipes does without language enforced purity, just with a caveat that functions sharing state might behave weirdly when fused.

Re:A philosophical difference between Haskell and Lisp (2015) by newen on Sunday August 02, 2020 @11:53PM (#24034068)
You could... I guess language designers generally avoid those types of optimizations since it can bring about unexpected results. As in, if syntactically the code is using one order of operations and semantically the code is using another order of operations, even if it's documented, lots of programmers would stumble into difficult to find bugs and be surprised by this behavior. Or worse, just get wrong results and never even find out it's wrong.