4 ms·
A type system being turing complete really isn't a problem. You bound the recursion depth in practice, and the chance of a real world programming hitting that l
by opnitro 5y ago
A type system being turing complete really isn't a problem.
You bound the recursion depth in practice, and the chance of a real world programming hitting that limit is minuscule.
Lot's of other languages have turing complete type systems, subtyping and typeclasses lead towards it.
- mseepgood 5y agoSure, if you regularly want to increase your #![recursion_limit] or #![type_length_limit] for the next generation of type bloat.
- socialdemocrat 5y agoHmmm I guess it is all in the eye of the beholder. If you are the kind of person who thinks C++ went wrong with its template system, then you might find issue with any language emulating C++ failures. If you think C++ is a beautiful well deigned language, then I am sure you will not have issues with Rust either.
- opnitro 5y agoJava & Haskell both have turing complete type systems as well. I'm not a particular fan of C++'s type system, doesn't mean have metaprogramming features is bad.
- bccdee 5y agoC++'s templates go too far — way further than Rust's generics go. Rust's type system may technically be Turning-complete, but nobody's actually doing serious* metaprogramming in it, unlike in C++, where template metaprogramming is a whole discipline unto itself. * not just toy examples
- opnitro 5y agoRight, because Rust provides a real macro system for metaprogramming.