💾 Archived View for station.martinrue.com › sdfgeoff › 270c03acf5f148f492d11fdce786ad89 captured on 2024-02-05 at 11:58:28. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-01-29)
-=-=-=-=-=-=-
Anyone know any good data 'container' formats - things like ".tar". It needs to concatenate files together and be able to separate them out again - no compression needed.
I don't want to use tar because the rust tar library is occupying some 26kb of my executable size (about 2%).
I could roll my own format, but thought I should ask to see if there are any existing ones?
Actually, migrating away from the serde library (and thus probably forgoing JSON) may well have larger executable-size benefits. Anyone know any human-readable formats that can represent graph structures nicely?
2 years ago · 👍 marginalia, lykso
Yeah. TSV files are (IMO) really easy to parse, if you reckon those are human-readable enough for your purposes. · 2 years ago
you can represent graph structures easily in most record formats. Simply have a collection of node objects with unique ids, and a collection of link objects that specify the node id at their start and end. · 2 years ago
Although, so long as we're doing custom, strict subsets, I guess parsing a strict JSON subset could be just as simple (if not more so). · 2 years ago
Depending on what sorts of values you need to represent, a strict subset of YAML might do you well. Just "key: value" with tabs indicating tree depth and lines beginning with "-" indicating array entries. There are also libraries for full-spec YAML parsing, but I don't know how they stack up against serde size-wise. · 2 years ago
Good old plain "ar" might be able to do the trick for ya if you don't need directory structure and whatnot. Interesting to optimize executable size, but if 26Kb is that much of a concern, then maybe consider invoking "tar" rather than including a library? Sacrifice performance for executable size, but if you're worrying about 26Kb that might be the way forward · 2 years ago
For graph representation, some subset of the DOT language would probably do well: https://graphviz.org/doc/info/lang.html · 2 years ago