3 ms·
I remember Wirth's approach of preferring recursive-descent over the bottom-up LR, LALR, SLR, etc., was quite controversial at the time, since prevailing wisdom
by userbinator 11y ago
I remember Wirth's approach of preferring recursive-descent over the bottom-up LR, LALR, SLR, etc., was quite controversial at the time, since prevailing wisdom was that bottom-up parser-generators could parse more complex grammars and were widely believed to be more efficient. Now it seems things have turned in the opposite direction, with both large production-quality compilers and simple educational "toy" ones using some variant of recursive-descent. When GCC switched from a Bison-generated parser to recursive-descent, it actually made it faster(https://gcc.gnu.org/wiki/New_C_Parser https://gcc.gnu.org/wiki/New_C_Parser ). The fact that LL languages are theoretically a subset of LR has not stopped recursive-descent from being used to successfully parse languages like C++ whose grammar is actually Turing-complete.
- WalterBright 11y agoThe Digital Mars C++ compiler used recursive descent since 1987 or so. It's certainly practical.
- logicchains 11y agoSlightly off topic, but as one of the only people in the world who's written a C++ compiler by themselves, how many manhours would you estimate it would take to update a C++03 compiler to fully support C++14? Or how many years; I think I remember reading you say somewhere that DMC++ took 10 years to code.
- WalterBright 11y agoI think I'm the only person who's written a complete C++ compiler by himself - preprocessor, parser, semantic analyzer, optimizer, and code generation. I also mean a C++98 compiler, because that's pretty much where I stopped. I don't know how much is involved in going from that to C++14, as I haven't done that. 10 man years is a good estimate for creating a C++ compiler, not including the C part nor the optimizer/codegen.