News for hackers. Stuff that matters.
Re:Plan to throw one away by legulere on Tuesday December 15, 2015 @02:48AM (#10736504)
Wow, this seems quite idiotic to me. Sure, recursive descent parsers have some theoretically inferior properties to other techniques, but in reality they're much better because you can actually handle errors in a user-friendly way. That's why basically every bigger compiler uses handwritten recursive descent parsers.
Re:Plan to throw one away by drothlis on Tuesday December 15, 2015 @04:22AM (#10736736)
There's a really gorgeous technique for implementing good error messages with LR parsers: http://lambda-the-ultimate.org/node/4781#comment-76724

(I haven't used the above personally, but the Golang parser does.)

Personally I have used PEG parsers and I was able to provide great error messages, by using the "cut" operator in the appropriate places in the grammar (see comments earlier in the thread I linked above).

Re:Plan to throw one away by dang on Tuesday December 15, 2015 @03:32AM (#10736615)
> this seems quite idiotic to me

Please don't be uncharitably dismissive. The author didn't throw away the parser because it was recursive descent—in fact he explicitly excludes that as a reason.

(The rest of your comment is fine.)

Re:Plan to throw one away by legulere on Tuesday December 15, 2015 @08:19AM (#10737579)
Sorry I was too harsh, but to me it reads much like: I personally don't like this code, so I threw away everything.
Re:Plan to throw one away by dang on Tuesday December 15, 2015 @02:00PM (#10739662)
It's true that that's a mega motivation lurking in the soul of every programmer. But it's also often true that writing a program can be faster than revising one (or even reading it) when the original programmer isn't available.

To me his justification sounded pretty convincing, though not to you, which is totally fair. As far as HN commenting goes it's just a matter of explaining your view in a substantive way.