Comment by snickerbockers
6 days ago
>People complain about LLM-generated code being “probabilistic”. No it isn’t. It’s code. It’s not Yacc output. It’s knowable
okay wtf is this weird jab at yacc supposed to be? I generally prefer to write my own LR parsers because it's really not that difficult but I never felt like yacc code was difficult to read or not "probabilistic".
AFAIK most serious compilers don't use yacc either because they need to be able to parse context-dependent grammars, and also reinventing wheels is often worth the effort when the wheel is 50 years old and forces you to make compromises because it also has to support use-cases you are not interested in. But again, it's not bad, it does the thing it is designed to do and it does save a lot of effort if you're fine dealing with its limitations.
Only serious complaint I have about Yacc is that the basic posix form has frustrating limitations such as not being able to have two separate yacc instances because they'll declare the same symbols, and I'm fairly certain it's not thread-safe either. Bison fixes some of these while still remaining "probabilistic".
Anyways I'd rather use Yacc+Lex (preferably Bison+flex) to generate my parser than have to go read everything your "agent" wrote with a fine-toothed comb to make sure it didn't introduce any crippling memory corruptions or dangerous ROPportunities.
No comments yet
Contribute on Hacker News ↗