You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The most important characteristic of the Turing machine is that you cannot solve the halting problem, whereas in C preprocessor you can always solve the halting problem: "yes".
The cpp was specifically designed not to be Turing complete. This is to avoid a host of issues that come with having a Turing complete language (mostly: it is very easy to accidentally create infinite loops). To avoid these problems, the cpp was "weakened" to be strongly normalizing, see https://en.wikipedia.org/wiki/Normalization_property_(abstract_rewriting). In particular, the cpp seems to be primitive recursive.
I wish you luck in revising the wiki page, and in all your endeavors. Thank you for your time.
The text was updated successfully, but these errors were encountered:
In that case, the C language (and all languages) are also primitive recursive, because all computers run out of memory, so there are always programs without a normal form: stack overflow. You're a genius.
In other words.. the folks who came up with the C preprocessor tried and failed to design it not to be Turing complete. Here is an implementation of a functional programming language in pure macros.
Thanks for your interest, @okovko. There is indeed a surprisingly broad range of things non-Turing-complete languages can do! However, note that while(1) never terminates or runs out of memory.
Hi, I'm quite enjoying the C preprocessor advice on your wiki! It's quite good. However, https://github.com/pfultz2/Cloak/wiki/Is-the-C-preprocessor-Turing-complete%3F beats around the bush a lot, but it should really start with "No." and end with "No." and contain discussion in between those statements.
The most important characteristic of the Turing machine is that you cannot solve the halting problem, whereas in C preprocessor you can always solve the halting problem: "yes".
The cpp was specifically designed not to be Turing complete. This is to avoid a host of issues that come with having a Turing complete language (mostly: it is very easy to accidentally create infinite loops). To avoid these problems, the cpp was "weakened" to be strongly normalizing, see https://en.wikipedia.org/wiki/Normalization_property_(abstract_rewriting). In particular, the cpp seems to be primitive recursive.
I wish you luck in revising the wiki page, and in all your endeavors. Thank you for your time.
The text was updated successfully, but these errors were encountered: