3 ms·
An example of a concrete usage of parser combinators and their performance: OCaml's http/af library [1] is a web server that uses parser combinators to implemen
by Zababa 5y ago
An example of a concrete usage of parser combinators and their performance: OCaml's http/af library [1] is a web server that uses parser combinators to implement HTTP 1.1. As for the performance, it's in the ballpark of Go's net/http and Rust's hyper [2]. There's also h2 [3] that implements HTTP 2. They are based on Angstrom [4], which started as a direct port of attoparsec [5], cited in the article. It's great to see all the cross-pollination happening in that space!
[1]: https://github.com/inhabitedtype/httpaf https://github.com/inhabitedtype/httpaf
[2]: https://github.com/ocaml-multicore/retro-httpaf-bench/pull/17 https://github.com/ocaml-multicore/retro-httpaf-bench/pull/1...
[3]: https://github.com/anmonteiro/ocaml-h2 https://github.com/anmonteiro/ocaml-h2
[4]: https://github.com/inhabitedtype/angstrom https://github.com/inhabitedtype/angstrom
[5]: https://github.com/haskell/attoparsec https://github.com/haskell/attoparsec