Why you should not use (f)lex, yacc and bison
tomassetti.me
Why you should not use (f)lex, yacc and bison
1–10 of 59 posts
Re: Why you should not use (f)lex, yacc and bison
#2I would have upvoted this article except for the fact that it popped up not one but two pop-up windows asking for my email address.
Re: Why you should not use (f)lex, yacc and bison
#3The title should have been 'Why you should use ANTLR and not use (f)lex, yacc and bison' as if ANTLR is the only alternative.
Re: Why you should not use (f)lex, yacc and bison
#4I would have upvoted this article except for the fact that it popped up not one but two pop-up windows asking for my email address.
Both of which were ads for ANTLR services, which is what they provide.
Re: Why you should not use (f)lex, yacc and bison
#5Previous discussion: https://news.ycombinator.com/item?id=22491536 (89 comments)
Re: Why you should not use (f)lex, yacc and bison
#6I 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
#7Glad 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
#8If you push out enough grammars that makes writing lexers and parsers by hand more work than learning tools for that, you will soon have all kinds of other problems.
Re: Why you should not use (f)lex, yacc and bison
#9I 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).
Re: Why you should not use (f)lex, yacc and bison
#10Too many pop-ups; I left the site.