Skip to content

Wiki page Is the C preprocessor Turing complete? should be more unequivocally no. #16

@wyattscarpenter

Description

@wyattscarpenter

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions