# \#serialization

**URL:** https://discuss.ocaml.org/tag/serialization/136.md

[Latest](https://discuss.ocaml.org/latest.md) · [Categories](https://discuss.ocaml.org/categories.md) · [Tags](https://discuss.ocaml.org/tags.md)

---

## [\[ANN\] bstr, slice & bin (bigstring, encoders & decoders for binary formats)](https://discuss.ocaml.org/t/ann-bstr-slice-bin-bigstring-encoders-decoders-for-binary-formats/18509)

<div class="topic-metadata">

**Author:** [@dinosaure](https://discuss.ocaml.org/u/dinosaure)\
**Replies:** 4\
**Last updated:** [September 6, 2026, 11:29am UTC](https://discuss.ocaml.org/t/ann-bstr-slice-bin-bigstring-encoders-decoders-for-binary-formats/18509 "2026-09-06T11:29:18Z")

</div>

I am delighted to announce the release of bstr.0.1.0, as well as bin.0.1.0 and slice.0.1.0. These releases are the result of a synthetic work between several libraries, aimed at bringing together everything that might be…

---

## ["locations" in s-expression/json for generated deserializers (a trip report)](https://discuss.ocaml.org/t/locations-in-s-expression-json-for-generated-deserializers-a-trip-report/18289)

<div class="topic-metadata">

**Author:** [@Chet\_Murthy](https://discuss.ocaml.org/u/Chet_Murthy)\
**Replies:** 3\
**Last updated:** [June 24, 2026, 6:47pm UTC](https://discuss.ocaml.org/t/locations-in-s-expression-json-for-generated-deserializers-a-trip-report/18289 "2026-06-24T18:47:47Z")

</div>

\[ETA: the thrust of this little trip-report, is: when you’re demarshalling JSON (or some other wireline) and you don’t know the -precise- format of that wireline, it helps to have generated deserializers that are identic…

---

## [Variant mapping to string and back](https://discuss.ocaml.org/t/variant-mapping-to-string-and-back/17813)

<div class="topic-metadata">

**Author:** [@vivanov](https://discuss.ocaml.org/u/vivanov)\
**Replies:** 3\
**Last updated:** [February 16, 2026, 4:16pm UTC](https://discuss.ocaml.org/t/variant-mapping-to-string-and-back/17813 "2026-02-16T16:16:09Z")

</div>

Hey, suppose I have a variant type type basic\_color = | Black | Red | Green | Yellow | Blue | Magenta | Cyan | White let to\_string = function | Black -\> "1" | Red -\> "2" | Green -\> "3" | Yellow…

---

## [Serialise XML to struct / type](https://discuss.ocaml.org/t/serialise-xml-to-struct-type/13770)

<div class="topic-metadata">

**Author:** [@janvhs](https://discuss.ocaml.org/u/janvhs)\
**Replies:** 1\
**Last updated:** [January 3, 2024, 3:31pm UTC](https://discuss.ocaml.org/t/serialise-xml-to-struct-type/13770 "2024-01-03T15:31:14Z")

</div>

Hi, I am very new to OCaml and know the concept of serialisation of data into structured types from languages like Go and Swift. I am looking for a library which allows me to serialise XML into data structures. I‘ve r…

---

## [JSON alternatives for OCaml web front-end + back-ends?](https://discuss.ocaml.org/t/json-alternatives-for-ocaml-web-front-end-back-ends/13633)

<div class="topic-metadata">

**Author:** [@toastal](https://discuss.ocaml.org/u/toastal)\
**Replies:** 4\
**Last updated:** [December 14, 2023, 3:47pm UTC](https://discuss.ocaml.org/t/json-alternatives-for-ocaml-web-front-end-back-ends/13633 "2023-12-14T15:47:50Z")

</div>

JSON is ubiquitous & a bit of a lingua franca with fast serialization. However, JSON while being a bit bloated (can be saved on the wire by compression) also lacks a lot of valuable built-in types: maps, sets, dates, ADT…

---

## [Version control of records](https://discuss.ocaml.org/t/version-control-of-records/11823)

<div class="topic-metadata">

**Author:** [@zfy](https://discuss.ocaml.org/u/zfy)\
**Replies:** 9\
**Last updated:** [March 30, 2023, 7:44am UTC](https://discuss.ocaml.org/t/version-control-of-records/11823 "2023-03-30T07:44:24Z")

</div>

Hi guys. When I update a record type by adding one field of option type, the deserialization of old version data will fail. Is there any tool that can directly add a none value to obtain new version data from original? …

---

## [\[ANN\] Orsetto: structured data interchange languages (release 1.1)](https://discuss.ocaml.org/t/ann-orsetto-structured-data-interchange-languages-release-1-1/7995)

<div class="topic-metadata">

**Author:** [@jhw](https://discuss.ocaml.org/u/jhw)\
**Replies:** 6\
**Last updated:** [June 18, 2021, 11:25am UTC](https://discuss.ocaml.org/t/ann-orsetto-structured-data-interchange-languages-release-1-1/7995 "2021-06-18T11:25:29Z")

</div>

Announcing the release to OPAM of Orsetto 1.1, an update to a personal project of mine not sponsored by my employer. Licensed with BSD 2-Clause. Q. What is Orsetto? Aspires to do eventually for OCaml more or less what S…

---

## [Yojson 2.0.0 plans](https://discuss.ocaml.org/t/yojson-2-0-0-plans/3263)

<div class="topic-metadata">

**Author:** [@NathanReb](https://discuss.ocaml.org/u/NathanReb)\
**Replies:** 46\
**Last updated:** [July 31, 2020, 3:26pm UTC](https://discuss.ocaml.org/t/yojson-2-0-0-plans/3263 "2020-07-31T15:26:50Z")

</div>

We’re planning on a Yojson 2.0.0 release as we’ve already started breaking the API by removing the dependency on biniou. Before going any further I wish to emphasize that nothing is set in stone yet and that’s mostly wh…

---

## [\[ANN\] Orsetto: structured data interchange languages (version 1.0)](https://discuss.ocaml.org/t/ann-orsetto-structured-data-interchange-languages-version-1-0/3920)

<div class="topic-metadata">

**Author:** [@jhw](https://discuss.ocaml.org/u/jhw)\
**Replies:** 18\
**Last updated:** [July 17, 2019, 12:39pm UTC](https://discuss.ocaml.org/t/ann-orsetto-structured-data-interchange-languages-version-1-0/3920 "2019-07-17T12:39:09Z")

</div>

I am pleased to announce the release of version 1.0 of my Orsetto project. As I wrote in the README file about it: Orsetto is a standalone library comprising a core toolkit… Core functional data structures and proces…

---

## [Is there a tool to do automatic serialization/deserialization AND automatic schema migration (from OCaml types)?](https://discuss.ocaml.org/t/is-there-a-tool-to-do-automatic-serialization-deserialization-and-automatic-schema-migration-from-ocaml-types/2606)

<div class="topic-metadata">

**Author:** [@jaredly](https://discuss.ocaml.org/u/jaredly)\
**Replies:** 11\
**Last updated:** [June 4, 2019, 3:23pm UTC](https://discuss.ocaml.org/t/is-there-a-tool-to-do-automatic-serialization-deserialization-and-automatic-schema-migration-from-ocaml-types/2606 "2019-06-04T15:23:30Z")

</div>

e.g. I have some data (represented by OCaml types), that I want to persist, for example in a database or somewhere (maybe in a json format, or protobuf, or whatever). ppx\_deriving\_yojson, ocaml-protoc, or atdgen all give…

---

## [\[ANN\] Orsetto: structured data interchange languages (preview release)](https://discuss.ocaml.org/t/ann-orsetto-structured-data-interchange-languages-preview-release/3304)

<div class="topic-metadata">

**Author:** [@jhw](https://discuss.ocaml.org/u/jhw)\
**Replies:** 12\
**Last updated:** [April 22, 2019, 4:11pm UTC](https://discuss.ocaml.org/t/ann-orsetto-structured-data-interchange-languages-preview-release/3304 "2019-04-22T16:11:04Z")

</div>

I am pleased to announce that I’ve reached the preview milestone I set for my Orsetto project. As I wrote in the README file about it: Orsetto is a standalone library comprising a core toolkit… Core functional data s…

---

## [\[ANN\] Yojson 1.6.0](https://discuss.ocaml.org/t/ann-yojson-1-6-0/3254)

<div class="topic-metadata">

**Author:** [@NathanReb](https://discuss.ocaml.org/u/NathanReb)\
**Replies:** 3\
**Last updated:** [January 31, 2019, 8:33am UTC](https://discuss.ocaml.org/t/ann-yojson-1-6-0/3254 "2019-01-31T08:33:00Z")

</div>

I’m happy to announce the release of Yojson version 1.6.0. In an effort to modernize it a little, each submodule now comes with a type t and equal, pp and show functions. The json aliases for t are being deprecated, th…

---

## [How to write, read file using bin\_prot?](https://discuss.ocaml.org/t/how-to-write-read-file-using-bin-prot/1961)

<div class="topic-metadata">

**Author:** [@mars0i](https://discuss.ocaml.org/u/mars0i)\
**Replies:** 2\
**Last updated:** [May 7, 2018, 8:38pm UTC](https://discuss.ocaml.org/t/how-to-write-read-file-using-bin-prot/1961 "2018-05-07T20:38:21Z")

</div>

I’m confused about how to use bin\_prot to write and read serialized data to/from a file. bin\_prot has many functions with “write” and “read” in their names, and some return functions with type writer, etc. (see Bin\_prot…

---

## [\[ANN\] Farfadet 0.2](https://discuss.ocaml.org/t/ann-farfadet-0-2/1211)

<div class="topic-metadata">

**Author:** [@dinosaure](https://discuss.ocaml.org/u/dinosaure)\
**Replies:** 0\
**Last updated:** [November 30, 2017, 8:49am UTC](https://discuss.ocaml.org/t/ann-farfadet-0-2/1211 "2017-11-30T08:49:06Z")

</div>

Hi all, I’m happy to announce a new release of farfadet.0.2, available for installation via OPAM. Farfadet is a little library on top of faraday to provide a better API to describe how to serialize an OCaml value with …
