# Orsetto: assorted structured data interchange languages

**URL:** <https://discuss.ocaml.org/t/orsetto-assorted-structured-data-interchange-languages/1991>\
**Category:** Community\
**Tags:** announce\
**Created:** [May 14, 2018, 1:08am UTC](https://discuss.ocaml.org/t/orsetto-assorted-structured-data-interchange-languages/1991 "2018-05-14T01:08:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhw](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/jhw/32/1639_2.png) [@jhw](https://discuss.ocaml.org/u/jhw)\
**Post date:** [May 14, 2018, 1:08am UTC](https://discuss.ocaml.org/t/orsetto-assorted-structured-data-interchange-languages/1991/1 "2018-05-14T01:08:51Z")

</div>

I have made available one of my personal side projects, [Orsetto](https://bitbucket.org/jhw/orsetto), for community review. My plan is for this library is for it to be an assortment of structured data interchange languages organized around a common foundation of various general purpose utilities. At the moment, only JSON is implemented, and I’m planning to implement CBOR next.

Much of the foundation layer in Orsetto originated in my now outdated _Oni_ project. That project also included some experimental work in concurrent network I/O, which I’m hoping to revisit in the context of the algebraic effects feature in development on the OCaml multicore project. In the meantime, Orsetto is generally useful in OCaml 4.06.1 and later.

I haven’t posted a package on OPAM yet. I’m waiting for the OPAM 2.0 migration. If you’re interested in playing with it now, then you’ll need to be using OPAM 2.0, then clone the repository and install it with a pinned local source tree.

---

<div class="post-metadata">

**Author:** ![jhw](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/jhw/32/1639_2.png) [@jhw](https://discuss.ocaml.org/u/jhw)\
**Post date:** [June 5, 2018, 6:01am UTC](https://discuss.ocaml.org/t/orsetto-assorted-structured-data-interchange-languages/1991/2 "2018-06-05T06:01:19Z")

</div>

Recent commits have included work in progress on the Unicode regular expression implementation. I’m still a way off from claiming RL1 conformance, but I can see the light at the end of that tunnel.

I’m also giving some thought to bringing over the MIME implementation from the old Oni side branch. Or not. Maybe MIME will go away if we clap hard enough and sing real loud.

---

<div class="post-metadata">

**Author:** ![jhw](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/jhw/32/1639_2.png) [@jhw](https://discuss.ocaml.org/u/jhw)\
**Post date:** [June 20, 2018, 2:09pm UTC](https://discuss.ocaml.org/t/orsetto-assorted-structured-data-interchange-languages/1991/3 "2018-06-20T14:09:47Z")

</div>

Recent commits now include a flyweight implementation of _Concise Binary Object Representation (CBOR)_ [[RFC 7049](https://tools.ietf.org/html/rfc7049)] using the **Cf\_encode** and **Cf\_decode** interfaces.

Also, I’ve made more progress on Unicode regular expressions. The remaining pieces of RL1 conformance in **Ucs\_regx** seem less pressing, because need for regular expressions in _Orsetto_ is somewhat limited to being an extension of the more general **Cf\_scan** and **Ucs\_scan** parsers. I plan to implement Unicode line and word boundary matching as scanners first, then as regular expression forms later.

---

<div class="post-metadata">

**Author:** ![jhw](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/jhw/32/1639_2.png) [@jhw](https://discuss.ocaml.org/u/jhw)\
**Post date:** [July 17, 2018, 2:41pm UTC](https://discuss.ocaml.org/t/orsetto-assorted-structured-data-interchange-languages/1991/4 "2018-07-17T14:41:29Z")

</div>

Over my summer vacation, I found the time to implement _The Base16, Base32, and Base64 Data Encodings_ [[RFC 4648](https://tools.ietf.org/html/rfc4648)]. I’ve also made some minor improvements to the **Cf\_encode** and **Cf\_decode** modules.

---

<div class="post-metadata">

**Author:** ![jhw](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/jhw/32/1639_2.png) [@jhw](https://discuss.ocaml.org/u/jhw)\
**Post date:** [July 23, 2018, 4:15am UTC](https://discuss.ocaml.org/t/orsetto-assorted-structured-data-interchange-languages/1991/5 "2018-07-23T04:15:15Z")

</div>

I refactored the old **Nx\_uri** module from _Oni_ into the new **Cf\_uri** module in _Orsetto_ and it’s passing all the unit tests. Some differences worth noting between my implementation and [the URI package from the _Mirage_ project](https://opam.ocaml.org/packages/uri/):

1. The _Mirage_ implementation uses the [Re](https://opam.ocaml.org/packages/re/) package on OPAM, and the _Orsetto_ implementation uses its own **Cf\_regx** module for constructing the URI component scanners. The lazy DFA engine for **Cf\_regx** is the same one used by the **Ucs\_regx** module that I mentioned previously in this thread.
2. The _Mirage_ implementation includes logic for parsing key/value parameters in query parts, and the _Orsetto_ implementation does not. (Providing delimiter-separated value structures is a separate task. See [Issue #15](https://bitbucket.org/jhw/orsetto/issues/15/design-and-implement-support-for) for details.)
3. The _Orsetto_ implementation does not implement structural equality and comparison on the decomposed structures. (I don’t see the point. String equality and comparison on the composed text should suffice.)
4. The _Orsetto_ implmentation uses syntax-based normalization, not protocol-based normalization. This is because the **Cf\_uri** module comprises only the generic syntax for URI and URI references with the generic path resolving logic. It doesn’t comprehend any of the protocol-specific extensions of the URI syntax. According to my design, those protocol-based normalization rules for URI should be implemented by extending the generic syntax-based normalization provided in the **Cf\_uri** module.

As mentioned above, anyone interested in tracking my progress is invited to follow the [issue reports](https://bitbucket.org/jhw/orsetto/issues) in the Bitbucket repository.

---

<div class="post-metadata">

**Author:** ![jhw](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/jhw/32/1639_2.png) [@jhw](https://discuss.ocaml.org/u/jhw)\
**Post date:** [October 12, 2018, 3:23am UTC](https://discuss.ocaml.org/t/orsetto-assorted-structured-data-interchange-languages/1991/6 "2018-10-12T03:23:49Z")

</div>

Things have been moving a little slowly lately because I’ve been distracted by the day job and a swarm of personal hassles. Project is not abandoned, just in the cooler for a bit. Hope to return to it with more energy in a few weeks.

---

<div class="post-metadata">

**Author:** ![jhw](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/jhw/32/1639_2.png) [@jhw](https://discuss.ocaml.org/u/jhw)\
**Post date:** [October 25, 2018, 4:52pm UTC](https://discuss.ocaml.org/t/orsetto-assorted-structured-data-interchange-languages/1991/7 "2018-10-25T16:52:58Z")

</div>

Not moving any faster yet, but I’ve finished basic support for RFC 3339 Internet Timestamp format, and I’ve decided not to do anything for UUID in the alpha milestone. Only a few minor cleanups to do, then I’ll start preparing the preview release to OPAM, which may happen in a few weeks if I’m lucky.
