News for hackers. Stuff that matters.
Re:Csexp: S-Expressions over the Network by koolba on Sunday June 11, 2023 @02:40PM (#36284292)
That looks surprisingly like bencode used by BitTorrent.
Re:Csexp: S-Expressions over the Network by neilv on Sunday June 11, 2023 @03:05PM (#36284530)
That was my first thought (maybe because I was thinking about Racket, and happened to hack up a quick bencode parser in Scheme, https://www.neilvandyke.org/racket/bencode/ ), but it's not just bencode.

I think a lot of data encoding protocols that are for arbitrary non-app-specific data needing more structure than Unix shell tools lines&whitespace, and intended to be simple, end up like this. You have a few types, some values are variable length, historically you often choose ASCII character set (for human readability, portability to different platforms, passability of different gateways), and you might as well minimize parsing lookahead, so there's some likely ways you'll signal types and sizes in the stream.

Google Protobufs (for another contemporary popular protocol) has somewhat different requirements, which leads to less-text result. But if you had those requirements (say, extensible types like in a traditional rich RPC mechanism, and maybe minimizing bandwidth), you might end up doing much the same thing.

Or, today, you and GPT-4 might just punt on "micro-optimizations", and layer atop JSON or maybe still XML.