5 ms·
I actually love parser-combinators. Something about writing them feels very 'correct' and they're often the first I reach for when I've got to parse something
by FridgeSeal 6y ago
I actually love parser-combinators.
Something about writing them feels very 'correct' and they're often the first I reach for when I've got to parse something and there isn't a pre-existing library.
It's one of the tasks Haskell feels especially well suited for: the function composition tools and the syntax make reading and writing them especially straightforward. Writing parser combinators in other languages just feels clunky.
- ben509 6y agoThey are honestly fun to write, but then you're doing recursive descent. Having written a significant one, I felt the elegance of the concept was marred by all the workarounds creeping into the code.