Thoughts on Canonical S-Expressions (2019)
write.emacsen.net
Thoughts on Canonical S-Expressions (2019)
1–10 of 15 posts
Re: Thoughts on Canonical S-Expressions (2019)
#2Re: Thoughts on Canonical S-Expressions (2019)
#3Re: Thoughts on Canonical S-Expressions (2019)
#4Readers may want to look at both of course!
Re: Thoughts on Canonical S-Expressions (2019)
#5 Canonical S-Expression: (9:groceries(4:milk5:bread))
Bencoding: l9:groceriesl4:milk5:breadee
Bencoding also manages to specify dictionaries, and yet still have a canonical encoding, by requiring dictionaries be sorted by key (and keys be unique).It doesn't have the option for arbitrary type names, it just has actual types: integer, bytestring, list and dictionary.
FTA:
> Bencoding offers many of the same benefits of CSEXP, but because it also supports types, is a bit easier to work with.
Hmm, well there you go.
Re: Thoughts on Canonical S-Expressions (2019)
#6Imagine if we had this instead of shitty ass C or asm lol
Re: Thoughts on Canonical S-Expressions (2019)
#7Canonical S-expressions seem remarkably similar to bencoding as used in BitTorrent files. They both use length prefixes written in ASCII digits followed by a colon. Canonical S-Expression: (9:groceries(4:milk5:bread)) Bencoding: l9:groceriesl4:milk5:breadee Bencoding also manages to specify dictionaries, and yet still have a canonical encoding, by requiring dictionaries be sorted by key (and keys be unique). It doesn…
Re: Thoughts on Canonical S-Expressions (2019)
#8* It can be used as schema-less
* allows attaching metadata tags to values (which can serve as type hints[1]), and
* encodes blobs efficiently
I have not used it, but in the space of flexible formats it appears to have other interesting properties. For instance it can encode a symbol table making symbols really compact in the rest of the message. Symbol tables can be shared out of band.
[1] https://amazon-ion.github.io/ion-docs/docs/spec.html#annot
Re: Thoughts on Canonical S-Expressions (2019)
#9We changed the url from https://en.wikipedia.org/wiki/Canonical_S-expressions to a non-Wikipedia article. (Wikipedia submissions are fine but if there's a good third-party source, those are usually preferred because they're less generic.) Readers may want to look at both of course!
Re: Thoughts on Canonical S-Expressions (2019)
#10This is exactly what edn does. Seems like the author would like edn but doesn’t mention it