Netstrings (1997)
cr.yp.to
Netstrings (1997)
1–10 of 30 posts
Re: Netstrings (1997)
#2Re: Netstrings (1997)
#3Re: Netstrings (1997)
#4Seems like a coherent, sensible proposal, as one might expect from djb. Any notable protocols use them?
Re: Netstrings (1997)
#5Seems like a coherent, sensible proposal, as one might expect from djb. Any notable protocols use them?
Re: Netstrings (1997)
#6Most 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/...
Re: Netstrings (1997)
#7Seems like a coherent, sensible proposal, as one might expect from djb. Any notable protocols use them?
s:size:value;
For strings, which is pretty similar. Size is in bytes.Re: Netstrings (1997)
#8Tagged 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, b…
Re: Netstrings (1997)
#9Seems like a coherent, sensible proposal, as one might expect from djb. Any notable protocols use them?
Re: Netstrings (1997)
#10 if (scanf("%9lu",&len) 999999999 bytes is bad */
if (getchar() != ':') barf();
buf = malloc(len + 1); /* malloc(0) is not portable */
if (!buf) barf();
if (fread(buf,1,len,stdin)
Ah, the wonders of error-handling in C. Also, I wonder what's wrong with buf = malloc(len ? len : 1);