Hacker News new | ask | show | jobs
by LPisGood 454 days ago
This is a cool use case that probably saved you some time, but writing a recursive descent parser is something freshman CS students do for a lab assignment.

It isn’t exactly breaking new ground or doing anything you couldn’t find with a quick google search.

1 comments

You want me to do a Google search for a parser for the language that I just invented?

If you have a parser generator tool that can go from zero to parser based on a few examples rather than a grammar, I’d love to hear about it.

> If you have a parser generator tool that can go from zero to parser based on a few examples rather than a grammar, I’d love to hear about it.

That's the part where the LLM would be useful. Turn the examples into a grammar, verify the grammar, and use a parser generator for the rest.

You know the code does what it should and you get there in minutes.

I'm pretty sure it could have done that equally easily, but this grammar is small enough that a parser generator is overkill. (I made that decision before I asked the LLM to write the parser.)