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.
[ Parent
| on HN ]
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.
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).