馃懡 sdfgeoff

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

Actions

馃憢 Join Station

6 Replies

馃懡 lykso

Yeah. TSV files are (IMO) really easy to parse, if you reckon those are human-readable enough for your purposes. 路 2 years ago

馃懡 marmaladefoo

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

馃懡 lykso

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

馃懡 lykso

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

馃懡 mcoffin

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

馃懡 marginalia

For graph representation, some subset of the DOT language would probably do well: https://graphviz.org/doc/info/lang.html 路 2 years ago

https://graphviz.org/doc/info/lang.html