Back to News
Advertisement
Advertisement

⚡ Community Insights

Discussion Sentiment

50% Positive

Analyzed from 155 words in the discussion.

Trending Topics

#https#uses#netstrings#tnetstrings#proposal#strings#here#raw#html#djb

Discussion (7 Comments)Read Original on HackerNews

regularfry•about 2 hours 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/...

bmacho•about 1 hour ago
Here's a HTML viewer (not mine; use it at your own risk): <https://html-preview.github.io/?url=https://raw.githubuserco...>
ocrow•about 2 hours ago
Seems like a coherent, sensible proposal, as one might expect from djb. Any notable protocols use them?
Scaevolus•about 2 hours 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.
asalahli•about 1 hour ago
Not sure if it counts as notable, but SCGI uses it too: https://python.ca/scgi/protocol.txt
toast0•about 2 hours ago
Php serialized uses

   s:size:value;
For strings, which is pretty similar. Size is in bytes.
gnabgib•about 3 hours ago
(1997) -DJB