News for hackers. Stuff that matters.
Re:Writing Parsers Like it is 2017 [pdf] by mattnewport on Wednesday June 28, 2017 @04:38PM (#14658134)
I thought most real world compilers tend to be hand written rather than using a generator? By no means an expert but that's something I've heard and know to be true for many real world compilers.
Re:Writing Parsers Like it is 2017 [pdf] by dukoid on Wednesday June 28, 2017 @04:49PM (#14658239)
Re:Writing Parsers Like it is 2017 [pdf] by amelius on Wednesday June 28, 2017 @05:26PM (#14658612)
They probably should have used this instead: http://scottmcpeak.com/elkhound/
Re:Writing Parsers Like it is 2017 [pdf] by int_19h on Wednesday June 28, 2017 @09:47PM (#14660146)
For C and especially C++, this makes a lot of sense. There's so much context dependence in the latter when you get to templates.
Re:Writing Parsers Like it is 2017 [pdf] by seanmcdirmid on Wednesday June 28, 2017 @10:25PM (#14660313)
Ya, heck, not just C++, but scala and C#. You can tune the heck out of error recovery when you write a parser by hand, as well as support IDE services.

Using a combinator or generator makes sense when you really care just about getting trees out as fast as possible; e.g. what a command line batch compiler or interpreter does.

Re:Writing Parsers Like it is 2017 [pdf] by amelius on Wednesday June 28, 2017 @05:14PM (#14658490)
I suppose that's because they take the standpoint that they have so much testing code available, that any conflicts with the grammar are easily found.

However, in general, you can easily shoot yourself in the foot with a handwritten parser, because you can't see the conflicts by looking at the code locally.

Re:Writing Parsers Like it is 2017 [pdf] by vidarh on Thursday June 29, 2017 @01:10AM (#14660942)
It's usually because getting proper (as in user-friendly) error reporting is a massively weak spot with ever parser generator I've seen to date.

Conflicts is generally one of the least interesting problems in writing a parser unless you're designing a new language, and especially when hand writing recursive descent parsers, potential conflicts/ambiguities tend to become obvious quickly.

For prototyping a new language, sure, use a parser generator to test the grammar.

I too fall in the category of loving the idea of parser generator (and having written a few) but always falling back on hand-written parsers because the generators I've seen have all been inadequate. I hope that chances some day.