29 ms·
Making string abstract or creating new string subtypes does not solve the underlying problem: Your type system isn't good enough. Now what I say this, let be c
by snprbob86 13y ago
Making string abstract or creating new string subtypes does not solve the underlying problem: Your type system isn't good enough.
Now what I say this, let be clear: I'm talking about everybody's type systems. That goes for you Haskell-ers too. And the post-Haskell rocket surgeons doing crazy advanced typing insanity.
Type systems are abstractions. The ones you are used to, like the Java-ish OOP ones or the ML/Haskell functional ones, are designed to detect and prevent a wide variety of programming errors, while also enabling analysis that will improve execution performance. However, there are many sorts of "type systems" that solve different problems.
- There are tree schemas for validation and data generation.
- There are database schemas for indexing and query planning.
- There are grammars for parsing and validating languages.
- There are contracts for ensuring preconditions, postconditions, and invariants.
- The list goes on for quite a while.
The idea that you can assign a single named type in a single kind of type system to a value and 100% verify the correctness of your software is just bogus. You need optional and pluggable type systems, so that you can bring a particular type system to meet a particular problem.