3 ms·
You kids and your unsafe typesystems. But seriously, what is the point of having a typesystem which is not sound? Nobody is going to mind if you create another
by tomjen3 15y ago
You kids and your unsafe typesystems.
But seriously, what is the point of having a typesystem which is not sound? Nobody is going to mind if you create another dynamic language ala Python, but design a type system (and force your users to use it) if it doesn't provide the protection against fucking up the types?
- jshen 15y ago"what is the point of having a typesystem which is not sound?" Because it gives plenty of benefits even when it's not "sound". What your suggesting is that there should never be any language between dynamic languages and haskell. Clearly there are many people who find type systems highly useful even if they don't go as far as haskell.
- barrkel 15y agoStatic type systems (particularly explicit rather than inferred ones) have multiple goals: as a form of documentation; as a way of specifying interfaces so pieces can be more reliably developed independently because the seam isn't just in documentation or peoples' heads or a bunch of unit tests; as a way of designing an app (when program = data + algorithms, some people like to start with the shape of the data); and finally as a way of proving more things about the code. I'd submit that the historical actual use of types doesn't emphasize the proof nature of types nearly as much as academic CS does. Unsound type systems are common in practical languages. And I believe that isn't accidental: because, with all the other things types are used for, you need an expressive type system, and that in turn means it is either going to be complex and sound, or simple and unsound (i.e. with escape valves like typecasting and runtime type errors - I'm considering compile-time type analysis only).
- gnaritas 15y agoHe just told you; to assist the IDE, things like automated refactoring, something Ruby still doesn't have to any reasonable degree. Type systems don't have to be perfect to be damn useful, if you like type systems.