News for hackers. Stuff that matters.
Re:The friendship between Haskell and C by Laaas on Friday March 17, 2023 @07:35AM (#35195628)
You pretend that they don't for morally pure functions like the ones from math.h.
Re:The friendship between Haskell and C by eesmith on Friday March 17, 2023 @08:35AM (#35196259)
I remember my surprise on a DEC Alpha in late 2001 when I did something like acos(3) and the floating-point exception triggered a core dump. As I recall, on the other OSes I used, SIGFPE was by default ignored.
Re:The friendship between Haskell and C by josefx on Friday March 17, 2023 @08:44AM (#35196366)
Isn't everything in math.h spamming errno?
Re:The friendship between Haskell and C by Joker_vD on Friday March 17, 2023 @08:58AM (#35196491)
It's not an observable side effect because nobody ever observes the value of errno :)
Re:The friendship between Haskell and C by k0k0r0 on Friday March 17, 2023 @09:53AM (#35197080)
Well, this is not true. However, to be fair, most important use case of errno in my work is debugging in horrible code bases, trying to understand what has happened.
Re:The friendship between Haskell and C by cryptonector on Friday March 17, 2023 @12:17PM (#35199106)
The FFI wrappers can restore the previous value of errno after reading the newer value after calling whatever foreign function, thus undoing that side-effect, and nothing other than a signal handler could observe this side-effect in the middle of the FFI wrapper's execution.

Oh, note to self: signal handlers need to restore errno values if they call async-signal-safe functions that can set errno.

Re:The friendship between Haskell and C by ParetoOptimal on Friday March 17, 2023 @10:01AM (#35197185)
And "Fast and loose reasoning is morally correct":

http://www.cs.ox.ac.uk/people/jeremy.gibbons/publications/fa...