3 ms·
Imagine trying to implement the C preprocessor. I had to write it from scratch 3 times before it worked 100%.
by WalterBright 1y ago
Imagine trying to implement the C preprocessor. I had to write it from scratch 3 times before it worked 100%.
- viega 1y agoWow, you are a braver person than I. Well done.
- WalterBright 1y agoThank you. I am actually perversely proud of it.
- le-mark 1y agoThis was back in 80s when you were working on c compilers? That’s an interesting story (80s compiler scene and what you worked on) I’ve picked up bits and pieces over the years, have you written it up anywhere? Would be benefit for many I think.
- WalterBright 1y agohttps://github.com/DigitalMars/dmpp https://github.com/DigitalMars/dmpp It's Boost licensed. Open sourced. No need for anyone else to struggle to implement a preprocessor.
- camel-cdr 1y agomicrosoft fixed their broken c preprocessor implementation just a few years ago
- WalterBright 1y agoThey could have just asked me :-)
- kragen 1y agoThey were deliberately leaving their C compiler broken because they considered C++ to be the replacement for C.
- WalterBright 1y agoC++ uses an identical preprocessor.
- kragen 1y agoThat has sometimes been true, but for example C++ didn't have variadic macros, maybe still doesn't, because they were added to C after Microsoft decided to stop following C development. https://stackoverflow.com/a/21515839 https://stackoverflow.com/a/21515839 goes into details of other differences.