3 ms·
> My question is, is there a real use-case for Turing-completeness inside a C++ compiler? That's a weird question because it seems to imply that "turing comple
by jkrems 12y ago
> My question is, is there a real use-case for Turing-completeness inside a C++ compiler?
That's a weird question because it seems to imply that "turing completeness" was a design goal of C++ templates. Afaik that's not the case, it's just an emergent feature of a powerful meta programming system. Also, turing-completeness doesn't mean much. It just means that there is some transformation that allows to general purpose programs to be written. It does not mean however, that it's practical, performant, or advisable. Things that are turing-complete include:
* Apache mod_rewrite
* The Scala type system
* Sendmail configuration
* Magic the Gathering
So, being turing-complete really is more of an interesting factoid, not actually a major achievement with any consequences for "real life".
See: http://beza1e1.tuxen.de/articles/accidentally_turing_complete.html http://beza1e1.tuxen.de/articles/accidentally_turing_complet...
- lern_too_spel 12y agoC++ compile times were bad enough before people realized that it's impossible to compute in some cases whether their compilation will ever complete.
- jkrems 12y agoExcept real, contemporary C++ compilers do not implement templates as turing complete: error: template instantiation depth exceeds maximum of 500 (use -ftemplate-depth-NN to increase the maximum) instantiating ‘struct a<500>’
- deleted 12y ago[deleted]