News for hackers. Stuff that matters.
Re:C Isn't a Programming Language Anymore by Hemospectrum on Monday November 07, 2022 @06:11PM (#33513848)
1. Doesn't the D compiler contain an entire C compiler? Half the point of that section was to say that any C parser is halfway to being a fully functional compiler. That's arguably an exaggeration, but I fail to see how D serves as a counterexample.

2. How does the D compiler handle GCC- and Clang-specific extensions to C?

Re:C Isn't a Programming Language Anymore by WalterBright on Monday November 07, 2022 @08:25PM (#33514908)
1. Yes, it does, but only the cparse.d file is for C. The rest of the "C" compiler hijacks the D semantic routines, code generator, and optimizer. There's also some custom work to turn #define's into simple declarations. If you just want to parse C, yes, you can just use cparse.d.

It's important to note that C cannot be fully parsed without keeping a symbol table, and cparse.d handles that, too.

2. C extensions will always be a problem. ImportC supports the most widely used ones. (Most C extensions are rarely used and can be ignored.)