Hacker News new | ask | show | jobs
by opnitro 1652 days 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.
2 comments

Sure, if you regularly want to increase your #![recursion_limit] or #![type_length_limit] for the next generation of type bloat.
Hmmm 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.

Java & 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.
C++'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

Right, because Rust provides a real macro system for metaprogramming.