Netstrings (1997)

8 points | by signa11 2 hours ago

5 comments

  • regularfry 35 minutes ago

    Tagged Netstrings (tnetstrings) was a related proposal from 15 years ago or so. It replaces the comma with a single-character type definition so you can do JSON-like objects with a couple of recursive types: you had ',', '#', '^', '!', and '~' for strings, integers, floats, booleans, and nulls, then ']' and '}' for lists and dictionaries.

    Most of the links have bitrotted and I don't think it ever got much traction, but I did always like how simple it was. There's a copy someone grabbed of the original spec here: https://raw.githubusercontent.com/ged/tnetstrings.info/refs/...

  • ocrow an hour ago

    Seems like a coherent, sensible proposal, as one might expect from djb. Any notable protocols use them?

      Scaevolus an hour ago

      BitTorrent's bencoding format, used in .torrent files, effectively uses netstrings-- but without the trailing commas, so it uses "5:hello" to represent filenames and similar.

      toast0 30 minutes ago

      Php serialized uses

         s:size:value;
      
      For strings, which is pretty similar. Size is in bytes.
  • gnabgib an hour ago

    (1997) -DJB