mort96 6 days ago

I would probably describe Perl as really complex to parse as well if I knew enough about it. Both are difficult to parse compared to languages with more "modern sensibilities" like Go and Rust, with their nice mostly context free grammars which can be parsed without terrible lexer hacks and separately from semantic analysis.

Walter Bright (who, among other things, has been employed to work on a C preprocessor) seems to disagree that the C preprocessor is simple to implement: https://news.ycombinator.com/item?id=20890749

> The preprocessor is fiendishly tricky to write. [...] I had to scrap mine and reimplement it 3 times.

I have seen other people in the general "C implementer/standards community" complain about it as well.

1
pjc50 6 days ago

I wonder if we can dig out the original K&R preprocessor implementation?

dbrower 6 days ago

it was a lot simpler in capabilities. much of the complexity is because of feature creep.

uecker 5 days ago

What feature creep did the preprocessor have?