Hacker News new | past | comments | ask | show | jobs | submit login

Yeah but even Haskell (and I'm assuming Scala has something similar) has unsafePerformIO...



The Haskell 2010 standard includes Foreign.Ptr which allows direct, unsafe manipulation of memory: https://www.haskell.org/onlinereport/haskell2010/haskellch35...


As 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.


It's a different kind of unsafe, but my point is that it violates the normal guarantees of the language.


But there is a compiler flag -XSafe which could guarantee none of your code uses it, meaning GP's answer could be yes.


We have that switch in Rust as well.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: