about summary refs log tree commit diff
path: root/pkgs/profpatsch/netencode
Commit message (Collapse)AuthorAgeFilesLines
* pkgs/profpatsch: adjust exec stuff to new skalibsProfpatsch2021-02-052-8/+37
| | | | | | | | | | | skarnet thought it would be wise to completely change the skalibs exec function interface without any backwards compat, so here we are. Have to reverse the code a bit, because `xmexec0` is a recursive `#define` pointing to `xmexec0_af`. `record-get` gets a rust treatment, it doesn’t really need the C interface just to exec into prog.
* pkgs/profpatsch/netencode: Encode into U instead of TProfpatsch2020-07-062-47/+43
| | | | | | | | This is an experiment about whether we can get away with using the non-recursive version by default. The U::Record variant uses a Vec instead of a HashMap by default, to make encoding from lists easier, and keep the ordering as given.
* pkgs/profpatsch: move record-get to netencodeProfpatsch2020-07-062-1/+66
|
* pkgs/profpatsch/netencode: add a netencode.nix to generate netencodeProfpatsch2020-06-271-0/+49
| | | | | We can define a more or less complete generator in less than 50 lines of nix. Nice.
* pkgs/profpatsch/netencode: actually enable parsing the binary typeProfpatsch2020-06-271-0/+2
|
* pkgs/profpatsch/netencode: add binary typeProfpatsch2020-06-262-3/+47
|
* pkgs/profpatsch/netencode: add support for boolProfpatsch2020-06-223-9/+43
| | | | | Instead of adding a new type, it just uses the 2^1 natural, which has exactly two possibilities.
* pkgs/profpatsch/netencode: add shallow parserProfpatsch2020-06-061-53/+160
| | | | | | | | | | | | | | | The “shallow” parser uses the fact that every netencode value is length-encoded (or a scalar with a fixed length). It does not need to parse the inner values in order to get the structure of the thing. That means that we can implement very fast structure-based operations, like “take the first 5 elements of a list” or “get the record value with the key name `foo`”. We can even do things like intersperse elements into a list of values and write the resulting netencode structure to a socket, without ever needing to copy the data (it’s all length-indexed pointers to bytes).
* pkgs/profpatsch: rename encode to netencodeProfpatsch2020-06-063-0/+533
Less generic, has the spirit of “netstrings, but extended to a structured encoding format”.