Start studying format options

Vectornaut 2025-02-25 08:32:24 +00:00
parent fddd2e615e
commit 517804c1e6

48
Storage-format.md Normal file

@ -0,0 +1,48 @@
## Rust frameworks
[Serde](https://serde.rs) is a very popular serialization framework for software written in Rust. It supports many [formats](https://serde.rs/#data-formats) out of the box. Here are the human-readable ones that are designed for hierarchical data and are supported for both serialization and deserialization:
* JSON
* YAML
* TOML
* RON
* JSON5
* S-expressions
## State of the art
Package manifests in [Julia](https://pkgdocs.julialang.org/v1/toml-files/), [Python](https://packaging.python.org/en/latest/tutorials/packaging-projects/#configuring-metadata), and [Rust](https://doc.rust-lang.org/cargo/reference/manifest.html) are all written in TOML.
## Comparison
### Table
Wikipedia has a pretty extensive [comparison of data-serialization formats](https://en.wikipedia.org/wiki/Comparison_of_data-serialization_formats).
### Downsides
These are articles I came across while trying to understand YAML's bad reputation. I made no attempt at an unbiased comparison between formats.
#### EDN
* [Pitfalls and bumps in Clojure's Extensible Data Notation (EDN)](https://nitor.com/en/articles/pitfalls-and-bumps-clojures-extensible-data-notation-edn)
#### JSON
* [The downsides of JSON for config files](https://www.arp242.net/json-config.html)
#### YAML
* [no(r)way yaml](https://norwayyaml.com/)
* [noyaml](https://noyaml.com/)
* [YAML: probably not so great after all](https://www.arp242.net/yaml-config.html)
## Floating-point representation
Ryan Juckett has written a detailed history of round-trip-stable string formatting algorithms for floating-point numbers.
> Ryan Juckett.["Printing Floating-Point Numbers"](https://www.ryanjuckett.com/printing-floating-point-numbers/) (2014).
A few years after this article was published, Ulf Adams introduced a new algorithm called [Ryū](https://github.com/ulfjack/ryu), which seems to be the current state of the art.
> Ulf Adams. ["Ryū: fast float-to-string conversion"](https://doi.org/10.1145/3192366.3192369) (2018).