4 ms·
As a language designer, Turing complete type systems are scary to reason about semantically. In the best case, they require magic numbers to restrict recursion,
by seanmcdirmid 10y ago
As a language designer, Turing complete type systems are scary to reason about semantically. In the best case, they require magic numbers to restrict recursion, and you have to ensure those numbers are applied everywhere necessary. A source of early scala bugs, for example, was finding another case where recursion limits needed to be added. And this wasn't code that was designed to stress the type system!
In the worst case, they just require way too much thought on behalf of users reading and writing the code. Amount up expressiveness often leads to type errors that are not very easy to understand, or lead to type errors that occur under very strange conditions.
- kibwen 10y agoGraydon was originally quite adamant that Rust's type system not be Turing-complete, but he eventually acknowledged how dreadfully hard it is to prevent Turing-completeness from accidentally leaking into a system and gave up that fight.
- lomnakkus 10y ago> [...] how dreadfully hard it is to prevent Turing-completeness from accidentally leaking into a system and gave up that fight. Yeah, that's my impression too. TC doesn't actually require all that much. (Of course, making it pleasant is a whole 'nother matter.)