# Idiomatic Parcoom (educational parser combinators library)

**URL:** <https://discuss.ocaml.org/t/idiomatic-parcoom-educational-parser-combinators-library/17379>\
**Category:** Community\
**Created:** [October 13, 2025, 9:10pm UTC](https://discuss.ocaml.org/t/idiomatic-parcoom-educational-parser-combinators-library/17379 "2025-10-13T21:10:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dx3mod](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/dx3mod/32/6740_2.png) [@dx3mod](https://discuss.ocaml.org/u/dx3mod)\
**Post date:** [October 13, 2025, 9:10pm UTC](https://discuss.ocaml.org/t/idiomatic-parcoom-educational-parser-combinators-library/17379/1 "2025-10-13T21:10:52Z")

</div>

I really enjoy using parser combinators libraries, such as [Angstrom](https://github.com/inhabitedtype/angstrom). I use it in [my Rpmfile library](https://github.com/dx3mod/rpmfile), and it’s very clean and expressive. My love for these started with [an Tsoding’s old stream about a dead simple parser combinator library called Parcoom.](https://www.youtube.com/watch?v=Y5IIXUBXvLs) This streak was the clearest explanation of the topic that I’ve ever seen. Since then, a lot of time has passed, but I decided to rewrite Parcoom’s original OCaml code in a more idiomatic implementation while preserving the original concept.

The result of my work you can find at [GitHub - dx3mod/parcoom: Parser combinators library](https://github.com/dx3mod/parcoom).

```ocaml
# #require "parcoom";;

# let open Parcoom in
  parse (char 'h' <*> any_char) "hello";;
- : _ * (char * char, _) result = ("llo", Ok ('h', 'e'))

```

---

<div class="post-metadata">

**Author:** ![lindig](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/lindig/32/532_2.png) [@lindig](https://discuss.ocaml.org/u/lindig)\
**Post date:** [October 14, 2025, 7:53am UTC](https://discuss.ocaml.org/t/idiomatic-parcoom-educational-parser-combinators-library/17379/2 "2025-10-14T07:53:01Z")

</div>

Parser combinators are cool because they blend the classical separation of lexing and parsing. This makes them well suited to parse binary formants - which is difficult with a Lex/Yacc approach. But they also come at a cost: potentially a lot of backtracking and ambiguity. How does your library deal with this and do you have any performance numbers? Angstrom claims to be high performance but I have not seen a performance comparison.
