News for hackers. Stuff that matters.
Re:GNU Bison 3.3 released by yanowitz on Saturday January 26, 2019 @02:17PM (#19007866)
They are used to build a number of tools you probably rely on or use regularly, including ruby, golang, bash, MySQL and postgresql.
Re:GNU Bison 3.3 released by CalChris on Saturday January 26, 2019 @05:00PM (#19008781)
golang uses a handwritten recursive decent parser and handwritten lexer.

https://github.com/golang/gofrontend/blob/master/go/parse.cc https://github.com/golang/gofrontend/blob/master/go/lex.cc

I can't think of a single major tool that uses ANTLR or bison. I say that being a huge ANTLR fan. Parser/lexer generators are really easy to use for DSLs but for real languages and tools, they're too heavyweight and constraining.

Re:GNU Bison 3.3 released by lower on Saturday January 26, 2019 @08:00PM (#19009697)
> Parser/lexer generators are really easy to use for DSLs but for real languages and tools, they're too heavyweight and constraining.

Haskell and OCaml are examples of real languages that use parser generators.

GHC: https://github.com/ghc/ghc/blob/master/compiler/parser/Parse...

Ocaml: https://github.com/ocaml/ocaml/blob/trunk/parsing/parser.mly

Re:GNU Bison 3.3 released by gnulinux on Saturday January 26, 2019 @06:52PM (#19009365)
GCC used to use bison. I don't think GCC became a major project recently. But you're correct that recursive descent is more efficient. Not everything is efficiency though (parsers are usually 1% of compile time since they're dirt cheap compared to code generator and especially static analyzer and optimizer). Bison makes parsing extremely simple. I can't see why anyone would use recursive descent unless they're a super major project and need to squeeze every ms.
Re:GNU Bison 3.3 released by wwright on Saturday January 26, 2019 @07:02PM (#19009410)
A big part of why tools move away from Bison and ANTLR isn’t performance, but UX (especially error reporting)
Re:GNU Bison 3.3 released by gnulinux on Saturday January 26, 2019 @08:05PM (#19009712)
In my experience recursive descent doesn't have any better error reporting than Bison or ANTLR. Parser combinators are much better if error reporting is what you're aiming for. Also, for LALR/LR parsers like Bison/ANTLR, the canonical trick is to encode errors in your grammar, which really isn't a huge deal. E.g. in pseudocode

    suite: stmt ';' stmt {/* ok */}
         | one_line_stmt NEWLINE stmt {raise("you need a ';' there buddy");}
         | // other rules
         ;
obviously this won't be useful for every case in general, otherwise why use ';' at all, but in most cases it'll give a helpful error.

Some more powerful parsers like Earley Algorithm have much worse error reporting.

Re:GNU Bison 3.3 released by ksherlock on Saturday January 26, 2019 @11:26PM (#19010340)
context sensitive grammars.
Re:GNU Bison 3.3 released by gnulinux on Saturday January 26, 2019 @11:50PM (#19010386)
You can deal with context sensitive grammars with "lexer trick" or multiple pass parsers.
Re:GNU Bison 3.3 released by grumpydba on Saturday January 26, 2019 @06:12PM (#19009178)
Re:GNU Bison 3.3 released by CamouflagedKiwi on Saturday January 26, 2019 @07:27PM (#19009529)
That's the gccgo frontend; the more usual Go compiler is here: https://github.com/golang/go/tree/master/src/cmd/compile/int...

It's still handwritten though so your point stands.

Re:GNU Bison 3.3 released by rvp-x on Sunday January 27, 2019 @01:57AM (#19010662)
Golang also has its own linker and assembler (going as far as having different notation for asm instructions), it doesn't count in these comparisons.
Re:GNU Bison 3.3 released by tptacek on Saturday January 26, 2019 @05:20PM (#19008900)
PHP appears to. It was the first language that came up in my Github search, and I stopped looking there.