Path: csiph.com!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: Ian Lance Taylor Newsgroups: comp.compilers Subject: Re: Are compiler developers light-years ahead of other software development? Date: Sat, 22 Jan 2022 15:40:02 -0800 Organization: Compilers Central Lines: 31 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <22-01-096@comp.compilers> References: <22-01-059@comp.compilers> <22-01-083@comp.compilers> <22-01-090@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="73989"; mail-complaints-to="abuse@iecc.com" Keywords: parse, tools Posted-Date: 22 Jan 2022 18:51:45 EST X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com In-Reply-To: <22-01-090@comp.compilers> Xref: csiph.com comp.compilers:2861 On Sat, Jan 22, 2022 at 3:26 PM Roger L Costello wrote: > > They ignored the rich theory and vast set of algorithms, in favor of their > own > proprietary code? Why would the C++ compiler developers do such a thing? > > /Roger > [My guess is that they were too busy chopping down trees to sharpen their > axes. -John] > The change in GCC away from using bison to a recursive descent parser was a considered decision on the part of the GCC C++ maintainers. I believe that the project started at https://gcc.gnu.org/legacy-ml/gcc/2000-10/msg00573.html and it was committed to the tree in December, 2002. In my experience bison/yacc parsers are really good for knowing the exact language that you are parsing. But it is difficult to make them generate good error messages and it is difficult to debug them. A language like C++ can only be parsed in conjunction with a symbol table, because the parsing depends on the semantic meaning of tokens; that too is difficult to do using yacc. So while I agree that yacc parsers are theoretically superior, I believe that experience shows that they have some problems in practice. In fact, I would be interested in knowing whether there is any generally used C++ compiler that uses a yacc parser. For example, clang also uses a recursive descent parser. Ian