4 ms·
Yeah but even Haskell (and I'm assuming Scala has something similar) has unsafePerformIO...
by steveklabnik 12y ago
Yeah but even Haskell (and I'm assuming Scala has something similar) has unsafePerformIO...
- codygman 12y agoBut there is a compiler flag -XSafe which could guarantee none of your code uses it, meaning GP's answer could be yes.
- steveklabnik 12y agoWe have that switch in Rust as well.
- olavk 12y agoAs far as I understand, unsafePerformIO is not unsafe in relation to memory safety issues. It is just unsafe in that it circumvents the IO monad, which means order of execution is not guaranteed.
- steveklabnik 12y agoIt's a different kind of unsafe, but my point is that it violates the normal guarantees of the language.
- dbaupp 12y agoThe Haskell 2010 standard includes Foreign.Ptr which allows direct, unsafe manipulation of memory: https://www.haskell.org/onlinereport/haskell2010/haskellch35.html https://www.haskell.org/onlinereport/haskell2010/haskellch35...