Hacker News new | ask | show | jobs
by KirinDave 5518 days ago
"I guess I'm not following, because type safety is a property of typed language. Expressive power is orthogonal."

This is where you have it wrong, and it's well known that it's wrong. Anyways...

Scala's is a series of compromises made to give a more expressive type system to a language that interacts with the JVM and and Java libraries. Saying its not "safe" to some arbitrary metric is neither insightful nor helpful to anyone. You can find it as "ironic" as you like, but it's not a particularly fair criticism by many metric.

2 comments

I'm guessing you've never actually proven type safety for a non-trivial language, if any. While there are many ways type safety could be stated for Scala, I'm pretty sure most Scala programmers would like the version of type safety that states "if I never use a type cast, I can never get a class cast exception." If you think that is too strong of a statement, then fine, but I think most people would agree this is a reasonable expectation for Scala.
a type system can be both logically consistent and expressive. the trade-off is with things like the efficiency with which it can prove the program is correct (and even the possibility that it cannot be proved at all).

what typesafety is talking about is errors. not trade-offs. that the type system says something is safe when it is not.