2 ms·
> This is definitely a problem, but the place to solve it isn't Son. But then what problem does Son actually solve? How is a canonicalisation format that's not
by patrec 9y ago
> This is definitely a problem, but the place to solve it isn't Son.
But then what problem does Son actually solve? How is a canonicalisation format that's not actually canonical useful?
You take a hit (e.g. by forgoing fast existing libraries, control over pretty printing, and by being forced to sort on serialization which screws up streaming), but gain essentially nothing, not even the advertised benefit of your stuff not randomly changing as it moves through the stack. The likely main benefit of canonicalization is for security and crypto, but unless you use son without numbers (or create your own subset of son) it's kinda useless for that. Of course you can just encode all your numbers in strings or something, but at the point where you're doing your own number parsing logic (which is the hardest bit), why not just use some well-designed actually canonical format like csexp?