2 ms·
Doesn't scala inherit type erasure from Java / the JVM though? That means nullability and sum and product types can never be sound in it, and every line can th
by hedora 4y ago
Doesn't scala inherit type erasure from Java / the JVM though? That means nullability and sum and product types can never be sound in it, and every line can throw some unexpected exception (just like Java), right?
On top of that, the classloader makes an open world assumption, at least with the JVM, so the compiler can never prove me wrong on any of the above points, regardless of what program it's been handed.
Anyway, I've been there and done that with Java, and I'm hoping to never put up with that ecosystem again. I'd much rather fight the borrow checker than deal with null pointer and class cast exceptions in production.
- otter-in-a-suit 4y agoIt does, but scalafix helps to avoid some of these issues. I’m not sure how important a very opinionated compiler is to you, but a compiler that does what it can + a good linter isn’t the worst combination. Once you tap into the Java ecosystem, you can often wrap things into the typelevel ecosystem and work with effects. Generally, Scala with cats/cats-effect is quite pleasant.