6 Appendix: Parsack vs Megaparsack

Megaparsack is not the only port of Parsec to Racket, and in fact, it isn’t even the first. The original Parsec port is Parsack. When looking for a parser combinator library, you might be unsure which one to pick, so this attempts to provide an unbiased comparison between the two libraries.

Without getting into the nitty gritty details, here’s a quick overview of the differences:

My general recommendation is to use Megaparsack unless performance is an issue, at which point it may be worth it to use Parsack, instead. However, while some of Megaparsack’s design decisions do make it inherently somewhat slower than Parsack, it’s likely that a lot of Megaparsack can be optimized much more than it currently is. If you run into performance problems with Megaparsack, feel free to open a bug report, and it might be possible to make Megaparsack palatably fast.