Live data from Hacker News

Why you should not use (f)lex, yacc and bison

tomassetti.me

1–10 of 59 posts

Re: Why you should not use (f)lex, yacc and bison

#6
I learned about the existence of Lex, Yacc, and Bison a bit more than 20 years while discussing the difficulties of debugging handwritten parsers with a friend.

But I was quickly discouraged by the complexity of using these tools, they are more like a new language that you have to learn.

Today I prefer writing parsers by hand, in C, like Fabrice Bellard, it is not super easy but manageable and I never encountered major issues.

I think that Lex/Yacc and similar tools are a good illustration of the power and shortcomings of metaprogramming.

There are some obvious use cases, but it is not always the best choice.

Re: Why you should not use (f)lex, yacc and bison

#7
Glad to hear the ANTLR vs Yacc holy way (a.k.a. LL vs LR) is still going strong. This one holy war may actually be older than emacs vs vi.

Have the ANTLR guys dropped their Java credo or they're still thinking they are going to convince any C developer with a .jar?

Re: Why you should not use (f)lex, yacc and bison

#9
I used ANTLR to build a query language parser and interpreter for a past employer. They had a specialized use case. ANTLR was pretty pleasant to use. The solution ended up being a pretty small amount of code and enabled much more powerful searching in their internal data viewing tool. I still think fondly about the project from time to time, partly because it was the one project where my fellow devs were just as happy with the tool as the non-dev users were (this was a very common tool for both devs and non-devs to use).
Post reply on HN