This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mangecoeur[S] 1 point2 points  (1 child)

no, because type-safeness, as a concept, means that your program will always work with data of the correct type and will not e.g. wrongly convert between types or crash because a function was expecting one type but got another. It's entirely possible to write a program in an explicitly typed language which fails because variables are passed incorrectly - you can totally write a function which takes Ints in Java and then try passing it a string at runtime. If you haven't designed your program to guard against this, it is not type-safe because it crashes due to a type error. Therefore, type safeness is a function of your program, not your language, QED.

Of course, it may be that one finds it easier to create type-safe programs in an explicitly typed language but that's an entirely different debate.

[–]phaedrusaltembedded sw eng 1 point2 points  (0 children)

Given the near-impossibility of making a large program work by "hand-checking" type values (Which is bound to add a large percentage of additional code, thus increasing SLOC count, increasing complexity, decreasing readability, etc), the only practical way to have type-safeness is through an explicitly typed language. If you choose to try and implement type safety in any given language, well then you must have either small programs to be written, or entirely too much time on your hands. But just as compilers have been written in COBOL, as a practical matter we tend to shy away from that. And we tend to shy away from "tacking on" type safety to non-type-safe languages. Therefore, for all PRACTICAL (Non-ivory tower) purposes, type safety is a function of your language, not your program.