Hello,
It’s my pleasure to announce the first release of the jsont libary:
Jsont is an OCaml library for declarative JSON data manipulation. It provides:
- Combinators for describing JSON data using the OCaml values of your choice. The descriptions can be used by generic functions to decode, encode, query and update JSON data without having to construct a generic JSON representation.
- A JSON codec with optional text location tracking and layout preservation. The codec is compatible with effect-based concurrency.
The descriptions are independent from the codec and can be used by third-party processors or codecs.
Jsont is distributed under the ISC license. It has no dependencies. The codec is optional and depends on the
bytesrw
library. The JavaScript support is optional and depends on thebrr
library.
The library has been used in practice but it’s new so a few adjustments may be needed and more convenience combinators added.
The library also enables quite a few things that I did not have the time to explore like schema description generation from descriptions, quasi-streaming JSON transformations, description generation from dynamic type representations, etc. Lots of this can be done outside the core library, do not hesitate to get in touch if you use the library and find interesting applications or pesking limitations.
Homepage: https://erratique.ch/software/jsont
Docs: https://erratique.ch/software/jsont/doc (or odig doc jsont
)
Install: opam install jsont bytesrw
This first release was made possible thanks to a grant from the OCaml Software Foundation. I also thank my donors for their support.
Best,
Daniel
P.S. I think that the technique used by the library, which I dubbed finally tagged is interesting in itself. You can read a paper about it here along with a smaller, self-contained, implementation of what the library does.