News for hackers. Stuff that matters.
Re:Parsing JSON is a Minefield by ChrisSD on Sunday April 22, 2018 @04:54PM (#16898518)
The problem is that formats like JSON are designed to be human readable and writable. Length prefixing is a non starter here.

Protobuf and similar are binary formats so don't have this limitation.

Re:Parsing JSON is a Minefield by zeveb on Tuesday April 24, 2018 @11:39AM (#16913505)
> The problem is that formats like JSON are designed to be human readable and writable. Length prefixing is a non starter here.

Canonical S-expression are both human-readable & length-prefixed. They do this by have an advanced representation which is human-friendly:

    (data (looks "like this" |YWluJ3QgaXQgY29vbD8=|))
And a canonical representation which is length-prefixed:

    (4:data(5:looks9:like this14:ain't it cool?))