From 517804c1e62716dc08ed85e54c7e27f39b460cd1 Mon Sep 17 00:00:00 2001 From: Vectornaut Date: Tue, 25 Feb 2025 08:32:24 +0000 Subject: [PATCH] Start studying format options --- Storage-format.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Storage-format.md diff --git a/Storage-format.md b/Storage-format.md new file mode 100644 index 0000000..41be5f7 --- /dev/null +++ b/Storage-format.md @@ -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). \ No newline at end of file