3 ms·
>> XML was never designed as a data serialization format. It's a markup language. > Those two things are not mutually exclusive. I beg to differ. I just repl
by ScottBurson 12y ago
>> XML was never designed as a data serialization format. It's a markup language.
> Those two things are not mutually exclusive.
I beg to differ. I just replied to someone else about this: https://news.ycombinator.com/item?id=9509110 https://news.ycombinator.com/item?id=9509110
I agree with your last paragraph, though. There is a timelessness about S-expressions.
As a side point, I would add that the distinction between strings and symbols is important, and neither XML nor JSON has it.
- lisper 12y agoThe comment you were responding to got deleted, which makes it a little hard to figure out what's going on there. But I am completely nonplussed at your assertion that markup and serialization are mutually exclusive. There is a 1-to-1 correspondence (actually multiple 1-to-1 mappings) between XML and S-expressions, so whatever you can do with sexprs you can do with XML modulo some trivial transformation. The ONLY difference is in the amount of punctuation and redundancy. > the distinction between strings and symbols is important Yeah, that's a good point. > neither XML nor JSON has it That's not quite true. It's not that JSON doesn't have symbols, it's that Javascript doesn't have symbols. And XML doesn't have symbols natively, but you can easily gin them up yourself, e.g. <symbol>foo</symbol> or <symbol name=foo />.
- ScottBurson 12y agoObviously you can encode S-expressions in XML (including symbols). But you have to add additional structure to do it. The point is that XML, following the markup metaphor, doesn't work this way out of the box. And, in fact, I've never seen anyone (except, I guess, you) go to the trouble of making all the distinctions in XML, such as the string/number distinction, that S-expressions make -- and I have seen people get into trouble for failure to do this. It's a psychological/sociological point rather than a technical one, but metaphors matter in design.