This is a reminiscence that may be a bit over-long. You may wish to spend your time wisely and just skip reading it ;-)
At the Oct. 6 meeting I made a vague reference to having heard about Scheme for the first time in connection with SGML. I was not altogether sure that my memory was correct, but a quick check in wikipedia confirms the connection. The sgml stylesheet language DSSSL is said to be "based on a subset of Scheme." (http://en.wikipedia.org/wiki/DSSSL )
Moreover, its connection with my own history now reminds me that, like Brian Connoy, I too missed an earlier chance to dive into learning lisp/lisp-like languages. This is where I first heard about Scheme.
In the early 2000's I was heavily involved in a project whose main objective was to put Canadian federal legislation online. XML was the big deal back then, so we planned to use it to mark up, store, print and search Canadian statutes and regulations.
One of the biggest problems encountered was how to print legislation marked up as XML. The legacy system used legislation created in WordPerfect, which was then converted to the input format of custom implementation of one of the phototypesetting engines of the day (I forget which one.) The legacy printing system was becoming unsupportable due to its age, the large quantity of cruft in the code and the gradual disappearance (through death, insanity etc.) of most people who knew how to use it.
The jackass whose responsibility it was to replace the legacy printing system had absolutely no clue about XML. He had spent years at the Canada Gazette, and had done everything in MS Word plus a bunch of crap he had kluged up in VB or some other horror. He absolutely could NOT grasp the idea of hierarchical data structures, trees etc. When I tried to explain recursion and tree structures to him he just lost his temper.
The project bogged down almost to the point of cancellation over this issue. The House of Commons techical staff were in a total panic.
I "tactfully" informed the project manager that the guy in charge of printing was a total fucking idiot. Eventually I began investigating methods of printing XML and SGML on my own. I discovered Jade (a DSSSL engine) and also JadeTex. I had used TeX heavily for some time, so I proposed that we go that direction.
As it turned out, DSSSL was in fairly bad repute with a lot of people who had considerable influence on the project. This was almost entirely because (to paraphrase these people) "DSSSL = Scheme and Scheme is *weird* and NOBODY uses Scheme for anything useful." This same bunch also had a lot of prejudice against TeX. The desktop publishing, or rather word processing paradigm ruled supreme in their world. And anyway, in the structured markup world at the time many people thought that SGML was too complex, and hence so was anything related to it. (That's why we have XML, I guess.) (For a contrary view check out some of the recently deceased Erik Naggum's rants about XML.)
At that point I began to investigate XSLT and XSL-FO. XSLT engines were reasonably advanced at the time (XSLT 1.0 I think). XSL-FO was pretty new. Only a rather half-baked open source version (FOP, an apache project) was readily available. Hardly anyone was all that worried about printing out XML, because the focus was all on its use for web site content, or SOAP, and that kind of stuff. So transforming XML to HTML and styling with CSS was about all anyone seemed to care about.
So, one April easter weekend I worked for four days straight (with about two hours of sleep per day) to do a 'proof of concept' print engine. I bashed together something using the project's XML for legislation and XSLT outputting to XSL-FO. This worked fairly well. It also gave me a quick introductory lesson in (more or less) functional style, or at least without being able to rely on side-effects.
As it all turned out, I had so offended the people in charge of the print engine project that they persuaded management to
(a) take my proof of concept stuff (b)hire consultants to produce a production-quality system based on it (c) acquire a commercial XSL-FO engine (Antenna House), and (d) banish me to some remote part of the project for having insulted the dimwit whose job I had largely done.
I became the official project pariah for a time. So much for being technically right, but tactlessly, vociferously, and impolitically so.
It would not surprise me to find out that the almost-functional nature of XSLT is based on the same rationale for basing DSSSL on Scheme. I have read some explanations of the advantages the designers thought might result from making XSLT side-effectless, but I did not understand them at the time. Perhaps learning Scheme some day might clarify the matter for me.
I seems that the prevailing prejudice against DSSSL and Scheme caused me to miss my chance to dive into the lisp/scheme world seven or eight years ago.
- Dave -
This list could probably use some activity, so your reminiscence is welcome.
As an aside, my own casual readings evoke the notion that XML is just a bad reinvention of LISP list structure ... but without the ability to EVAL any of it.
Luckily, I never touch the stuff!
BC
-----Original Message----- From: David Penton [mailto:djp@arqux.com] Sent: Wednesday, October 07, 2009 2:20 PM To: toronto-lisp@common-lisp.net Subject: [toronto-lisp] SGML, Scheme and a historical anecdote
This is a reminiscence that may be a bit over-long. You may wish to spend your time wisely and just skip reading it ;-)
At the Oct. 6 meeting I made a vague reference to having heard about Scheme for the first time in connection with SGML. I was not altogether sure that my memory was correct, but a quick check in wikipedia confirms the connection. The sgml stylesheet language DSSSL is said to be "based on a subset of Scheme." (http://en.wikipedia.org/wiki/DSSSL )
Moreover, its connection with my own history now reminds me that, like Brian Connoy, I too missed an earlier chance to dive into learning lisp/lisp-like languages. This is where I first heard about Scheme.
In the early 2000's I was heavily involved in a project whose main objective was to put Canadian federal legislation online. XML was the big deal back then, so we planned to use it to mark up, store, print and search Canadian statutes and regulations.
One of the biggest problems encountered was how to print legislation marked up as XML. The legacy system used legislation created in WordPerfect, which was then converted to the input format of custom implementation of one of the phototypesetting engines of the day (I forget which one.) The legacy printing system was becoming unsupportable due to its age, the large quantity of cruft in the code and the gradual disappearance (through death, insanity etc.) of most people who knew how to use it.
The jackass whose responsibility it was to replace the legacy printing system had absolutely no clue about XML. He had spent years at the Canada Gazette, and had done everything in MS Word plus a bunch of crap he had kluged up in VB or some other horror. He absolutely could NOT grasp the idea of hierarchical data structures, trees etc. When I tried to explain recursion and tree structures to him he just lost his temper.
The project bogged down almost to the point of cancellation over this issue. The House of Commons techical staff were in a total panic.
I "tactfully" informed the project manager that the guy in charge of printing was a total fucking idiot. Eventually I began investigating methods of printing XML and SGML on my own. I discovered Jade (a DSSSL engine) and also JadeTex. I had used TeX heavily for some time, so I proposed that we go that direction.
As it turned out, DSSSL was in fairly bad repute with a lot of people who had considerable influence on the project. This was almost entirely because (to paraphrase these people) "DSSSL = Scheme and Scheme is *weird* and NOBODY uses Scheme for anything useful." This same bunch also had a lot of prejudice against TeX. The desktop publishing, or rather word processing paradigm ruled supreme in their world. And anyway, in the structured markup world at the time many people thought that SGML was too complex, and hence so was anything related to it. (That's why we have XML, I guess.) (For a contrary view check out some of the recently deceased Erik Naggum's rants about XML.)
At that point I began to investigate XSLT and XSL-FO. XSLT engines were reasonably advanced at the time (XSLT 1.0 I think). XSL-FO was pretty new. Only a rather half-baked open source version (FOP, an apache project) was readily available. Hardly anyone was all that worried about printing out XML, because the focus was all on its use for web site content, or SOAP, and that kind of stuff. So transforming XML to HTML and styling with CSS was about all anyone seemed to care about.
So, one April easter weekend I worked for four days straight (with about two hours of sleep per day) to do a 'proof of concept' print engine. I bashed together something using the project's XML for legislation and XSLT outputting to XSL-FO. This worked fairly well. It also gave me a quick introductory lesson in (more or less) functional style, or at least without being able to rely on side-effects.
As it all turned out, I had so offended the people in charge of the print engine project that they persuaded management to
(a) take my proof of concept stuff (b)hire consultants to produce a production-quality system based on it (c) acquire a commercial XSL-FO engine (Antenna House), and (d) banish me to some remote part of the project for having insulted the dimwit whose job I had largely done.
I became the official project pariah for a time. So much for being technically right, but tactlessly, vociferously, and impolitically so.
It would not surprise me to find out that the almost-functional nature of XSLT is based on the same rationale for basing DSSSL on Scheme. I have read some explanations of the advantages the designers thought might result from making XSLT side-effectless, but I did not understand them at the time. Perhaps learning Scheme some day might clarify the matter for me.
I seems that the prevailing prejudice against DSSSL and Scheme caused me to miss my chance to dive into the lisp/scheme world seven or eight years ago.
- Dave -
_______________________________________________ toronto-lisp mailing list toronto-lisp@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/toronto-lisp
XML at least defines a few things like attributes. With s-expressions how one handles attributes and the possible values an attribute can be are rather undefined. Some communities will have common patterns but is there really a standard to say the same thing as XML?
XML also allows PCDATA which would require another agreement.
In a DTD-less manner Sexprs and XML are pretty close but unless you agree upon some XML-ish semantics they are not equivalent.
If anyone has a good example of a common idiom for doing this that is accepted and written out I'd like to hear of it. So far I'm only aware of Rivest S-exprs which I would suggest is XML without attributes and PCDATA but with entities, lists, strings and character types.
* XML is not equivalent to S-Exprs and vice versa ** They are probably reducible to each other * I'd like to know if I'm wrong or there are S-Expr standards out there that handle what XML handles.
abram
Brian Connoy wrote:
This list could probably use some activity, so your reminiscence is welcome.
As an aside, my own casual readings evoke the notion that XML is just a bad reinvention of LISP list structure ... but without the ability to EVAL any of it.
Luckily, I never touch the stuff!
BC
-----Original Message----- From: David Penton [mailto:djp@arqux.com] Sent: Wednesday, October 07, 2009 2:20 PM To: toronto-lisp@common-lisp.net Subject: [toronto-lisp] SGML, Scheme and a historical anecdote
This is a reminiscence that may be a bit over-long. You may wish to spend your time wisely and just skip reading it ;-)
At the Oct. 6 meeting I made a vague reference to having heard about Scheme for the first time in connection with SGML. I was not altogether sure that my memory was correct, but a quick check in wikipedia confirms the connection. The sgml stylesheet language DSSSL is said to be "based on a subset of Scheme." (http://en.wikipedia.org/wiki/DSSSL )
Moreover, its connection with my own history now reminds me that, like Brian Connoy, I too missed an earlier chance to dive into learning lisp/lisp-like languages. This is where I first heard about Scheme.
In the early 2000's I was heavily involved in a project whose main objective was to put Canadian federal legislation online. XML was the big deal back then, so we planned to use it to mark up, store, print and search Canadian statutes and regulations.
One of the biggest problems encountered was how to print legislation marked up as XML. The legacy system used legislation created in WordPerfect, which was then converted to the input format of custom implementation of one of the phototypesetting engines of the day (I forget which one.) The legacy printing system was becoming unsupportable due to its age, the large quantity of cruft in the code and the gradual disappearance (through death, insanity etc.) of most people who knew how to use it.
The jackass whose responsibility it was to replace the legacy printing system had absolutely no clue about XML. He had spent years at the Canada Gazette, and had done everything in MS Word plus a bunch of crap he had kluged up in VB or some other horror. He absolutely could NOT grasp the idea of hierarchical data structures, trees etc. When I tried to explain recursion and tree structures to him he just lost his temper.
The project bogged down almost to the point of cancellation over this issue. The House of Commons techical staff were in a total panic.
I "tactfully" informed the project manager that the guy in charge of printing was a total fucking idiot. Eventually I began investigating methods of printing XML and SGML on my own. I discovered Jade (a DSSSL engine) and also JadeTex. I had used TeX heavily for some time, so I proposed that we go that direction.
As it turned out, DSSSL was in fairly bad repute with a lot of people who had considerable influence on the project. This was almost entirely because (to paraphrase these people) "DSSSL = Scheme and Scheme is *weird* and NOBODY uses Scheme for anything useful." This same bunch also had a lot of prejudice against TeX. The desktop publishing, or rather word processing paradigm ruled supreme in their world. And anyway, in the structured markup world at the time many people thought that SGML was too complex, and hence so was anything related to it. (That's why we have XML, I guess.) (For a contrary view check out some of the recently deceased Erik Naggum's rants about XML.)
At that point I began to investigate XSLT and XSL-FO. XSLT engines were reasonably advanced at the time (XSLT 1.0 I think). XSL-FO was pretty new. Only a rather half-baked open source version (FOP, an apache project) was readily available. Hardly anyone was all that worried about printing out XML, because the focus was all on its use for web site content, or SOAP, and that kind of stuff. So transforming XML to HTML and styling with CSS was about all anyone seemed to care about.
So, one April easter weekend I worked for four days straight (with about two hours of sleep per day) to do a 'proof of concept' print engine. I bashed together something using the project's XML for legislation and XSLT outputting to XSL-FO. This worked fairly well. It also gave me a quick introductory lesson in (more or less) functional style, or at least without being able to rely on side-effects.
As it all turned out, I had so offended the people in charge of the print engine project that they persuaded management to
(a) take my proof of concept stuff (b)hire consultants to produce a production-quality system based on it (c) acquire a commercial XSL-FO engine (Antenna House), and (d) banish me to some remote part of the project for having insulted the dimwit whose job I had largely done.
I became the official project pariah for a time. So much for being technically right, but tactlessly, vociferously, and impolitically so.
It would not surprise me to find out that the almost-functional nature of XSLT is based on the same rationale for basing DSSSL on Scheme. I have read some explanations of the advantages the designers thought might result from making XSLT side-effectless, but I did not understand them at the time. Perhaps learning Scheme some day might clarify the matter for me.
I seems that the prevailing prejudice against DSSSL and Scheme caused me to miss my chance to dive into the lisp/scheme world seven or eight years ago.
- Dave -
toronto-lisp mailing list toronto-lisp@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/toronto-lisp
toronto-lisp mailing list toronto-lisp@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/toronto-lisp
BTW, I take it that top-posting is the style here. If not, let me know.
I am interested in this topic because I intend to try to implement some xml functionality in Lisp as a first major learning project. Although there is some open source stuff around to handle xml in Lisp, it appears not to implement anything but older xml standards.
As to xml versus sexps...I just don't think that one size fits all. I am really enjoying the ultra-simple syntax of Lisp. But when it comes to creating structured documents for stuff that I have worked on in the past, xml has a lot going for it.
Markup (sgml, xml etc.) seems to have come from a different place historically than sexps. (I may be wrong, this is not something I have researched in any depth.)
The people who invented sgml did not use their own sgml technology for e.g. sgml schemas (which were DTDs: an Extended Backus-Naur form, that I never loved) or stylesheet/transforms (which as I mentioned used a subset of Scheme.)
Things changed a bit with xml. It's pretty good for document markup (what Michael Kay calls "narrative xml") and machine-readable data representation. But I think the use of it for xml transforms (XSLT) and schemas (XML SCHEMA) was a bad move. I hate the warty, verbose syntax compared to e.g. Lisp.
Apparently I am not alone in my belief that xml-based programming languages are not a great idea. XSLT must embed XPath, which has a totally non-xml syntax, as does XQuery - in the latter case maybe because the SQL crowd would not tolerate xml syntax. Another example - the guy who did the main DSSSL implementation (James Clark) invented an alternative to XML SCHEMA that offers a non-xml schema language as an alternative.
People made a big deal of the fact that XSLT can transform XSLT because it is xml. I guess it is a much better alternative than e.g. altering XSLT with perl or something. However, in my (early non-expert opinion( there is no comparison between XSLT transforming XSLT and the capability for Lisp to fiddle with itself.
Having said that I have put some time into becoming proficient with XSLT despite its yucky syntax.
On 2009-10-07, at 3:06 PM, Abram Hindle wrote:
XML at least defines a few things like attributes. With s-expressions how one handles attributes and the possible values an attribute can be are rather undefined. Some communities will have common patterns but is there really a standard to say the same thing as XML?
XML also allows PCDATA which would require another agreement.
In a DTD-less manner Sexprs and XML are pretty close but unless you agree upon some XML-ish semantics they are not equivalent.
If anyone has a good example of a common idiom for doing this that is accepted and written out I'd like to hear of it. So far I'm only aware of Rivest S-exprs which I would suggest is XML without attributes and PCDATA but with entities, lists, strings and character types.
- XML is not equivalent to S-Exprs and vice versa
** They are probably reducible to each other
- I'd like to know if I'm wrong or there are S-Expr standards out
there that handle what XML handles.
abram
Brian Connoy wrote:
This list could probably use some activity, so your reminiscence is welcome.
As an aside, my own casual readings evoke the notion that XML is just a bad reinvention of LISP list structure ... but without the ability to EVAL any of it.
Luckily, I never touch the stuff!
BC
-----Original Message----- From: David Penton [mailto:djp@arqux.com] Sent: Wednesday, October 07, 2009 2:20 PM To: toronto-lisp@common-lisp.net Subject: [toronto-lisp] SGML, Scheme and a historical anecdote
This is a reminiscence that may be a bit over-long. You may wish to spend your time wisely and just skip reading it ;-)
At the Oct. 6 meeting I made a vague reference to having heard about Scheme for the first time in connection with SGML. I was not altogether sure that my memory was correct, but a quick check in wikipedia confirms the connection. The sgml stylesheet language DSSSL is said to be "based on a subset of Scheme." (http://en.wikipedia.org/wiki/DSSSL )
Moreover, its connection with my own history now reminds me that, like Brian Connoy, I too missed an earlier chance to dive into learning lisp/lisp-like languages. This is where I first heard about Scheme.
In the early 2000's I was heavily involved in a project whose main objective was to put Canadian federal legislation online. XML was the big deal back then, so we planned to use it to mark up, store, print and search Canadian statutes and regulations.
One of the biggest problems encountered was how to print legislation marked up as XML. The legacy system used legislation created in WordPerfect, which was then converted to the input format of custom implementation of one of the phototypesetting engines of the day (I forget which one.) The legacy printing system was becoming unsupportable due to its age, the large quantity of cruft in the code and the gradual disappearance (through death, insanity etc.) of most people who knew how to use it.
The jackass whose responsibility it was to replace the legacy printing system had absolutely no clue about XML. He had spent years at the Canada Gazette, and had done everything in MS Word plus a bunch of crap he had kluged up in VB or some other horror. He absolutely could NOT grasp the idea of hierarchical data structures, trees etc. When I tried to explain recursion and tree structures to him he just lost his temper.
The project bogged down almost to the point of cancellation over this issue. The House of Commons techical staff were in a total panic.
I "tactfully" informed the project manager that the guy in charge of printing was a total fucking idiot. Eventually I began investigating methods of printing XML and SGML on my own. I discovered Jade (a DSSSL engine) and also JadeTex. I had used TeX heavily for some time, so I proposed that we go that direction.
As it turned out, DSSSL was in fairly bad repute with a lot of people who had considerable influence on the project. This was almost entirely because (to paraphrase these people) "DSSSL = Scheme and Scheme is *weird* and NOBODY uses Scheme for anything useful." This same bunch also had a lot of prejudice against TeX. The desktop publishing, or rather word processing paradigm ruled supreme in their world. And anyway, in the structured markup world at the time many people thought that SGML was too complex, and hence so was anything related to it. (That's why we have XML, I guess.) (For a contrary view check out some of the recently deceased Erik Naggum's rants about XML.)
At that point I began to investigate XSLT and XSL-FO. XSLT engines were reasonably advanced at the time (XSLT 1.0 I think). XSL-FO was pretty new. Only a rather half-baked open source version (FOP, an apache project) was readily available. Hardly anyone was all that worried about printing out XML, because the focus was all on its use for web site content, or SOAP, and that kind of stuff. So transforming XML to HTML and styling with CSS was about all anyone seemed to care about.
So, one April easter weekend I worked for four days straight (with about two hours of sleep per day) to do a 'proof of concept' print engine. I bashed together something using the project's XML for legislation and XSLT outputting to XSL-FO. This worked fairly well. It also gave me a quick introductory lesson in (more or less) functional style, or at least without being able to rely on side-effects.
As it all turned out, I had so offended the people in charge of the print engine project that they persuaded management to
(a) take my proof of concept stuff (b)hire consultants to produce a production-quality system based on it (c) acquire a commercial XSL-FO engine (Antenna House), and (d) banish me to some remote part of the project for having insulted the dimwit whose job I had largely done.
I became the official project pariah for a time. So much for being technically right, but tactlessly, vociferously, and impolitically so.
It would not surprise me to find out that the almost-functional nature of XSLT is based on the same rationale for basing DSSSL on Scheme. I have read some explanations of the advantages the designers thought might result from making XSLT side-effectless, but I did not understand them at the time. Perhaps learning Scheme some day might clarify the matter for me.
I seems that the prevailing prejudice against DSSSL and Scheme caused me to miss my chance to dive into the lisp/scheme world seven or eight years ago.
- Dave -
toronto-lisp mailing list toronto-lisp@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/toronto-lisp
toronto-lisp mailing list toronto-lisp@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/toronto-lisp
toronto-lisp mailing list toronto-lisp@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/toronto-lisp
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.
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.
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.
Vish
On Thu, Oct 8, 2009 at 11:16 PM, David Penton djp@arqux.com wrote:
BTW, I take it that top-posting is the style here. If not, let me know.
I am interested in this topic because I intend to try to implement some xml functionality in Lisp as a first major learning project. Although there is some open source stuff around to handle xml in Lisp, it appears not to implement anything but older xml standards.
As to xml versus sexps...I just don't think that one size fits all. I am really enjoying the ultra-simple syntax of Lisp. But when it comes to creating structured documents for stuff that I have worked on in the past, xml has a lot going for it.
Markup (sgml, xml etc.) seems to have come from a different place historically than sexps. (I may be wrong, this is not something I have researched in any depth.)
The people who invented sgml did not use their own sgml technology for e.g. sgml schemas (which were DTDs: an Extended Backus-Naur form, that I never loved) or stylesheet/transforms (which as I mentioned used a subset of Scheme.)
Things changed a bit with xml. It's pretty good for document markup (what Michael Kay calls "narrative xml") and machine-readable data representation. But I think the use of it for xml transforms (XSLT) and schemas (XML SCHEMA) was a bad move. I hate the warty, verbose syntax compared to e.g. Lisp.
Apparently I am not alone in my belief that xml-based programming languages are not a great idea. XSLT must embed XPath, which has a totally non-xml syntax, as does XQuery - in the latter case maybe because the SQL crowd would not tolerate xml syntax. Another example - the guy who did the main DSSSL implementation (James Clark) invented an alternative to XML SCHEMA that offers a non-xml schema language as an alternative.
People made a big deal of the fact that XSLT can transform XSLT because it is xml. I guess it is a much better alternative than e.g. altering XSLT with perl or something. However, in my (early non-expert opinion( there is no comparison between XSLT transforming XSLT and the capability for Lisp to fiddle with itself.
Having said that I have put some time into becoming proficient with XSLT despite its yucky syntax.
On 2009-10-07, at 3:06 PM, Abram Hindle wrote:
XML at least defines a few things like attributes. With s-expressions how one handles attributes and the possible values an attribute can be are rather undefined. Some communities will have common patterns but is there really a standard to say the same thing as XML?
XML also allows PCDATA which would require another agreement.
In a DTD-less manner Sexprs and XML are pretty close but unless you agree upon some XML-ish semantics they are not equivalent.
If anyone has a good example of a common idiom for doing this that is accepted and written out I'd like to hear of it. So far I'm only aware of Rivest S-exprs which I would suggest is XML without attributes and PCDATA but with entities, lists, strings and character types.
- XML is not equivalent to S-Exprs and vice versa
** They are probably reducible to each other
- I'd like to know if I'm wrong or there are S-Expr standards out
there that handle what XML handles.
abram
Brian Connoy wrote:
This list could probably use some activity, so your reminiscence is welcome.
As an aside, my own casual readings evoke the notion that XML is just a bad reinvention of LISP list structure ... but without the ability to EVAL any of it.
Luckily, I never touch the stuff!
BC
-----Original Message----- From: David Penton [mailto:djp@arqux.com] Sent: Wednesday, October 07, 2009 2:20 PM To: toronto-lisp@common-lisp.net Subject: [toronto-lisp] SGML, Scheme and a historical anecdote
This is a reminiscence that may be a bit over-long. You may wish to spend your time wisely and just skip reading it ;-)
At the Oct. 6 meeting I made a vague reference to having heard about Scheme for the first time in connection with SGML. I was not altogether sure that my memory was correct, but a quick check in wikipedia confirms the connection. The sgml stylesheet language DSSSL is said to be "based on a subset of Scheme." (http://en.wikipedia.org/wiki/DSSSL )
Moreover, its connection with my own history now reminds me that, like Brian Connoy, I too missed an earlier chance to dive into learning lisp/lisp-like languages. This is where I first heard about Scheme.
In the early 2000's I was heavily involved in a project whose main objective was to put Canadian federal legislation online. XML was the big deal back then, so we planned to use it to mark up, store, print and search Canadian statutes and regulations.
One of the biggest problems encountered was how to print legislation marked up as XML. The legacy system used legislation created in WordPerfect, which was then converted to the input format of custom implementation of one of the phototypesetting engines of the day (I forget which one.) The legacy printing system was becoming unsupportable due to its age, the large quantity of cruft in the code and the gradual disappearance (through death, insanity etc.) of most people who knew how to use it.
The jackass whose responsibility it was to replace the legacy printing system had absolutely no clue about XML. He had spent years at the Canada Gazette, and had done everything in MS Word plus a bunch of crap he had kluged up in VB or some other horror. He absolutely could NOT grasp the idea of hierarchical data structures, trees etc. When I tried to explain recursion and tree structures to him he just lost his temper.
The project bogged down almost to the point of cancellation over this issue. The House of Commons techical staff were in a total panic.
I "tactfully" informed the project manager that the guy in charge of printing was a total fucking idiot. Eventually I began investigating methods of printing XML and SGML on my own. I discovered Jade (a DSSSL engine) and also JadeTex. I had used TeX heavily for some time, so I proposed that we go that direction.
As it turned out, DSSSL was in fairly bad repute with a lot of people who had considerable influence on the project. This was almost entirely because (to paraphrase these people) "DSSSL = Scheme and Scheme is *weird* and NOBODY uses Scheme for anything useful." This same bunch also had a lot of prejudice against TeX. The desktop publishing, or rather word processing paradigm ruled supreme in their world. And anyway, in the structured markup world at the time many people thought that SGML was too complex, and hence so was anything related to it. (That's why we have XML, I guess.) (For a contrary view check out some of the recently deceased Erik Naggum's rants about XML.)
At that point I began to investigate XSLT and XSL-FO. XSLT engines were reasonably advanced at the time (XSLT 1.0 I think). XSL-FO was pretty new. Only a rather half-baked open source version (FOP, an apache project) was readily available. Hardly anyone was all that worried about printing out XML, because the focus was all on its use for web site content, or SOAP, and that kind of stuff. So transforming XML to HTML and styling with CSS was about all anyone seemed to care about.
So, one April easter weekend I worked for four days straight (with about two hours of sleep per day) to do a 'proof of concept' print engine. I bashed together something using the project's XML for legislation and XSLT outputting to XSL-FO. This worked fairly well. It also gave me a quick introductory lesson in (more or less) functional style, or at least without being able to rely on side-effects.
As it all turned out, I had so offended the people in charge of the print engine project that they persuaded management to
(a) take my proof of concept stuff (b)hire consultants to produce a production-quality system based on it (c) acquire a commercial XSL-FO engine (Antenna House), and (d) banish me to some remote part of the project for having insulted the dimwit whose job I had largely done.
I became the official project pariah for a time. So much for being technically right, but tactlessly, vociferously, and impolitically so.
It would not surprise me to find out that the almost-functional nature of XSLT is based on the same rationale for basing DSSSL on Scheme. I have read some explanations of the advantages the designers thought might result from making XSLT side-effectless, but I did not understand them at the time. Perhaps learning Scheme some day might clarify the matter for me.
I seems that the prevailing prejudice against DSSSL and Scheme caused me to miss my chance to dive into the lisp/scheme world seven or eight years ago.
- Dave -
toronto-lisp mailing list toronto-lisp@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/toronto-lisp
toronto-lisp mailing list toronto-lisp@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/toronto-lisp
toronto-lisp mailing list toronto-lisp@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/toronto-lisp
toronto-lisp mailing list toronto-lisp@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/toronto-lisp
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
I find that this topic is one upon which people often have strong opinions. I don't wish to fan the fires of this debate, but I have one small thing to say.
The Web would have been more successful if another structure had been
used.
I'm not sure about that. Even now, I sometimes use a text editor to edit my HTML files. Imagine if I wanted to italicize a single word in a large document. In HTML I simply wrap that text with <i>. But if HTML had used an S-exp syntax, I would have to perform the following operation:
Starting with: (html (body "........large block of text..........."))
Split it into: (html (body "........block1......." "word-to-be-italicized" "......block2......"))
Wrap it with the i tag: (html (body "........block1......." (i "word-to-be-italicized") "......block2......"))
It would be difficult to perform this operation while keeping the document somewhat comprehensible, whereas in HTML the <i> is quite unobtrusive to the eye.
Perhaps in these modern times I shouldn't still be using a text editor for this. At the very least I should use some sort of structure editor, or some Emacs macros. But imagine how this issue would have slowed the adoption of the early Web.
I'm making a historical point only. That markup languages won in this particular domain at this particular point in history doesn't mean they're actually a good solution to other problems. But I think it's worth understanding why they won.
Vish
On Sat, Oct 10, 2009 at 2:46 PM, Rudolf Olah omouse@gmail.com wrote:
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