4 ms·
Why do we need two different syntaxes for representing trees? Both XML and their so-called "HSS" are redundant. S-expressions are a much cleaner syntax, and can
by PommeDeTerre 15y ago
Why do we need two different syntaxes for representing trees? Both XML and their so-called "HSS" are redundant. S-expressions are a much cleaner syntax, and can be used to represent both the "markup" and the "styling" in this case.
For crying out loud, let's finally unify the syntaxes, rather than creating yet another way to represent tree structures.
- matzipan 15y agoJust to make it clear, HSS is directly replacing CSS. No markup there. You are missing the point, unfortuantely, the whole idea of the project is to sepparate the data from the presentation. Mixing them together would be pretty similar to what HTML was in 2005. Not desirable.
- CodeMage 15y agoI believe you're missing his point: he said unify the syntax, not mix the data with the presentation.
- matzipan 15y agoOh, I totally understand. Thanks CodeMage. Sorry for the misunderstanding. XML is a widely-used data interchange format. It is well known and used. It's focus is the actual content. The syntax of HSS/CSS focuses on attributes. Makes for a perfect use in this case.
- weavejester 15y agoI don't believe PommeDeTerre is saying that semantic information needs to be mixed with presentation information. He or she is asking why you have two different syntaxes when all you're doing in both cases is representing a nested tree. For example, you could have your data structure as: (books (book (title "Little Schemer"))) And then define your presentation as: (books (book (title (:color "ff6666")))) I'm not saying that this is necessarily the best representation, but it's more consistent and simpler for a machine to parse than XML/HSS.
- alexchamberlain 15y agoWas that sarcastic? S-expressions aren't readable. Furthermore, we used to have a mess of a language that combined style and markup. We moved onto separating the 2, so we could develop more flexible websites.
- CodeMage 15y agoOkay, I don't get it: why does everyone assume that having the same syntax for trees automatically means you have to put everything in the same tree?
- alexchamberlain 15y agoHaving reread the comment, I can see what you mean. There are massive advantages to 2 different syntaxes.
- weavejester 15y agoWhat massive advantages are those? I mean there are obvious disadvantages in that you have to write two different parsers, and learn two separate syntaxes. What are the advantages?
- matzipan 15y agowavejester, for the sake of not reposting:read below.
- weavejester 15y agoSo if I understand you right, you're using XML for data because it's well known, and you've created HSS because XML isn't really suitable for styling? Presumably that means you're prioritising developer familiarity over architectural simplicity?
- matzipan 15y agoNo. XML is clear and precise. It supports namespace extensibility. It also provides a very big ecosystem that AXR actually use.