I'm not sure what world you're living in, but Haskell and ML seem to offer some measure of type safety and are also quite practical. Sure there is unsafePerformIO. But the problem is with Scala you don't even need to use unsafe language features to get an unexpected class cast exception. Given that you worked on Scala I'm rather surprised you don't know about this already.