# Parser Combinator Library and faster JSON parser

**URL:** <https://racket.discourse.group/t/parser-combinator-library-and-faster-json-parser/4524>\
**Category:** General\
**Created:** [December 3, 2026, 10:54pm UTC](https://racket.discourse.group/t/parser-combinator-library-and-faster-json-parser/4524 "2026-12-03T22:54:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nixpulvis](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/nixpulvis/32/2851_2.png) [@nixpulvis](https://racket.discourse.group/u/nixpulvis)\
**Post date:** [December 3, 2026, 10:54pm UTC](https://racket.discourse.group/t/parser-combinator-library-and-faster-json-parser/4524/1 "2026-12-03T22:54:58Z")

</div>

I have done some API rework and optimizations for my [GitHub - nixpulvis/parser-combinator: CFG Parser Combinators for Racket · GitHub](https://github.com/nixpulvis/parser-combinator) library recently and I think it's almost ready for a 2.0 release. I wanted to share some results and see what people think.

First the API is quite nice IMO, supporting things like `seq`, `alt`, `opt`, and more for building parsers. It now also supports lexing tokens to make parsers easier to write for things like skipping whitespace, or comments. It also has a parser called `pmap` for converting the production's value directly while parsing, which works similarly to other parser combinator libraries I've used.

I recommend reading the JSON implementation, it's ~150 lines of code at the moment and most of that is unicode handling: [parser-combinator/json.rkt at master · nixpulvis/parser-combinator · GitHub](https://github.com/nixpulvis/parser-combinator/blob/master/json.rkt)

It's also quite a bit faster than Racket's own `json` module's `string->jsexpr` function:

 ![image](https://global.discourse-cdn.com/free1/uploads/racket/original/2X/7/798c4122f9d08163205af128f7f1c229b0b54e1d.png)

I'm still trying to clean up the implementation a bit. I've recently added better error messages, but there are likely better ways to do things I haven't found.

Would love to hear what people think.
