[toronto-lisp] SGML, Scheme and a historical anecdote

Rudolf Olah omouse at gmail.com
Sat Oct 10 18:46:36 UTC 2009


Vishvajit Singh wrote:
> My simple approach to the question of markup languages vs. s-expressions is:
>
> Generally prefer s-exps for structured data, but in the special case
> of data in which the leaf nodes are the main player, containing most
> of the data, then markup languages sometimes make sense. So, for
> example, web pages are mostly text, so it's annoying to worry about
> the text being an element within a larger tree. It's easier to
> consider the text as the main player, with "markup" around it.
>   
Markup languages are a horrible idea. They mix the idea of content with
structure and with style. Content can be made to fit within different
structures and different styles can be applied to those structures.
Markup makes it impossible to cleanly copy content from page to another
because you have to first remove the structure.

Ted Nelson wrote about why markup languages are awful: Embedded Markup
Considered Harmful --> http://www.xml.com/pub/a/w3j/s3.nelson.html
> So, the original idea of HTML is a great idea. The web would have been
> less successful if they had chosen a sexp-based syntax, because it
> would have been more difficult for ordinary people to create their own
> webpages.
>   
The Web would have been more successful if another structure had been
used. As it is, almost no one can use or design a graphical tool for
designing web pages because of the HTML mess. You aren't supposed to
deal directly with the data format because you could make a mistake and
make it invalid. We don't edit music file tags directly by hand, do we?
> However, I think extending this idea to the problem of general data
> representation is a bad one. XML is overly verbose (the name of every
> node in the tree needs to be entered twice) and therefore hard to
> read. And don't get me started on XSLT.. I spent a summer working with
> that once. (Not something I wish to remember.)
>
> In the general case of arbitrarily structured data, I think s-exps are
> both easier to parse and more human-readable than XML.
>   
Depending on the structure, it might be better to store it as a binary
file of some sort and then give tools to users/developers to interact
with the data in a safe way. I have never understood why we don't trust
data from the user and clean it up in web & desktop applications but
then completely ignore that when it comes to configuration files, XML,
HTML, etc.

It all comes down to trade-offs and determining what the goals of the
data format are.

So Mr Penton, if you want to use s-expressions instead of XML-looking
markup, then you'll have to determine what the goal of XML is and
whether or not it is worthwhile to follow in their footsteps. Remember,
not everything is best represented as a tree.

-Rudolf Olah




More information about the toronto-lisp mailing list