How do the 2 parsers compare w.r.t error messaging?
Haskell has Parsec/Megaparsec which have better error messages, but are extremely slow.
How do the 2 parsers compare w.r.t error messaging?
Haskell has Parsec/Megaparsec which have better error messages, but are extremely slow.
For this specific post, the main thing I do is ignore the error messages and just look at where parsing fails by retrieving the leftovers when it fails (using the lower-level `parse` function). Usually that gave me enough of a clue to figure out what was going wrong.
Trifecta has the best error messages, but takes some more work to fully make the error messages great.
Took around 20 seconds to parse a few hundred thousand lines (almost no backtracking, too).
Attoparsec/parsec have very similar APIs. I wonder why it cannot parse optimistically with attoparsec, and in case of failure - re-parse with parsec to get a nice error message. This should yield the best of both worlds?
[1]: https://github.com/merijn/lambda-except [2]: https://github.com/quchen/stgi/blob/master/src/Stg/Parser/Pa...