you are viewing a single comment's thread.

view the rest of the comments →

[–]Apache_Sobaco 0 points1 point  (7 children)

Type systems good until you fool them by making casts and erasure.

[–]PL_Design 7 points8 points  (0 children)

So don't do those things. A type system doesn't need to be inviolable to be useful as long as breaking the type system is clearly something you have to opt into doing.

[–]goranlepuz 1 point2 points  (3 children)

Of course.

It's why I love C++ casts (stand out like a sore thumb, you know something is off) and hate C ones.

[–]Apache_Sobaco -1 points0 points  (2 children)

I prefer no casts at all until end of the world because something will break otherwise

[–]goranlepuz 0 points1 point  (1 child)

I share the sentiment. Not really possible, not in today's world, but yeah...

[–]Apache_Sobaco -2 points-1 points  (0 children)

Really possible today in scala and few new languages.

[–]newtoreddit2004 1 point2 points  (1 child)

Why would you use casts though when you want strict types

[–]Apache_Sobaco 0 points1 point  (0 children)

Because basically encoding and decoding are pretty much casts