3 ms·
"the compiler might get yell at you when you hit the maximum allowed type recursion limit" is an example of the compiler failing to compile something which is v
by jameshart 10y ago
"the compiler might get yell at you when you hit the maximum allowed type recursion limit" is an example of the compiler failing to compile something which is valid in the type system.
- gpderetta 10y agoSure, the point is that it happens rarely with real world code and you can always bump the compiler limit.
- jameshart 10y agoRight, but that's precisely how Turing completeness works. It's possible to write a program that can figure out whether most real world code terminates. All Turing completeness tells you is that no matter how clever that program gets, there will be some programs (not necessarily 'real world programs') which it won't be able to process. The fact that the Java programming language is Turing complete doesn't prevent us being able to write programs in it (indeed it means we can write interesting programs in it!). It is just a result that tells us there are some things we can't say about ALL Java programs. This is a similar result. The fact that the Java type system is turing complete doesn't stop us expressing things with it. It just tells us there are some things we can't say about ALL Java type declarations.