News for hackers. Stuff that matters.
Re:Haskell and Rust by kyllo on Sunday November 10, 2019 @02:05AM (#21496835)
UB exactly means that it's up to the implementation to decide the behavior because the language spec doesn't. "Implementation-defined" == UB.
Re:Haskell and Rust by saagarjha on Sunday November 10, 2019 @03:13AM (#21497037)
No, there's a distinction. "Implementation defined" means that every implementation is free to do what it likes, but it must document what it does. Undefined behavior is illegal to have in your program, period, and means the implementation has no restrictions on what it can do–including being inconsistent.
Re:Haskell and Rust by tome on Sunday November 10, 2019 @02:52AM (#21496959)
No it doesn’t. Implementation-defined means that the implementer must know and document the behaviour (define it). Undefined behaviour may well be behaviour that the implementer does not understand at all (for example it may invoke other undefined behaviour from another part of the system or an underlying system).