4 ms·
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 unsafePerfor
by typetheoristic 14y ago
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.
- seanmcdirmid 14y agoCould you be more specific? Is the compiler promising more than it can deliver, or are you saying the compiler could check something but simply doesn't? You can have 100% type safety in a straight jacket, but scala pushes what it tries to type check to an extreme limit; "safe" but then also not as conservative as Haskell or ML. I see scala as the c++ of statically typed languages, filling that niche where you need more from your managed language and are willing to take a leap, but this is controversial and a personal opinion.
- SourPatch 14y agoDo you have an example of code that will throw an unexpected ClassCastException?
- pkolaczk 14y agoI never, ever had a ClassCastException in Scala that I wasn't warned about by the compiler. Maybe in theory you are right. But what counts is practice.