On 14/11/2008, at 1:04 PM, Paul Davis wrote:

I don't think we need canonical JSON.

The Spec definitely needs to be disambiguated though. As I see it
there are two interpretations:

1. Order of fields matters which means repeated fields are ok
2. Order does not matter which means repeated fields are NOT ok

Given that JSON is executable Javascript, 2 is the only interpretation that allows for roundtrip equivalence.

Not sure if it's obvious or not, but switching from case 2 to 1 is
straightforward. Also, my current array diff implementation is kinda
whack. And indels screw the rest of the diff, as in, its not so much a
diff as a delete rest and add new. Getting this optimal is actually an
N^2 runtime algorithm via dynamic programming (smith-waterman style)

The algorithm described here: http://www.springerlink.com/content/r1t6h8631868k615/ is O(n), and although it isn't optimal, I'm guessing the performance stability makes up for it.

Antony Blakey
-------------
CTO, Linkuistics Pty Ltd
Ph: 0438 840 787

Did you hear about the Buddhist who refused Novocain during a root canal?
His goal: transcend dental medication.


Reply via email to