On Sun, 23 May 2010 06:55:50 -0700 (PDT) faenvie <faen...@googlemail.com> wrote:
> today i read this statement in a blog-post: > > "... remarkably (La)TeX is much better suited for composing and > distributing most types of documents than any other modern > word processor on the market that I am aware of. Just like > programming languages tend to converge towards Lisp because > it got things right the first time around, so do the Word > Processors tend to converge towards (La)TeX." Another analog to LISP: most people don't know what they're really dealing with. Even the blog you quoted from got that wrong. (La)TeX is a document processor, not a mere word processor. Which is why it's so good at composing and distributing documents. Of course - again like LISP - this has led to it generally being ignored outside the circles that adopted it early on, and made life hard for it's commercial competitors (Scribe and FrameMaker being the two that come to mind readily). One difference is that TeX didn't get it right first; that would be Scribe. But Scribe was sold and support for the free version vanished, leading to it pretty much withering away. To redraw the parallels: Clojure is cool for a number of reasons, but those that it inherited from LISP aren't unique to it - any LISP should have them. (La)TeX is also cool for a number of reasons, but those that it shares with other document processing languages aren't unique to it, either - any good document processing language should have them. In particular, SGML has many of those features. It also has a lot of cruft for dealing with legacy document types, which make doing a full-featured SGML implementation difficult. Once you've got it, you can do outright magic, but there just aren't that many people who can write the thing in the first place. XML is an "SGML application" with many of the options set so that pretty much any competent programmer can build an XML implementation (it's sometimes called "SGML for dummies"). HTML was sorta-kinda SGML; the SGML standard was amended (via the "web annex") so that HTML would qualify, those increasing the number of SGML documents in the world by many orders of magnitude. > what about combining (la=)tex and clojure for implememting > extraordinary document-processing ? These days, most people generate some form of SGML (usually XML or (X)HTML) instead of (La)TeX, for a number of reasons. One is that the language is easier to deal with in code than TeX, both as input and as output. This means that while there are lots of tools to manipulate and format SGML, there aren't so many to deal with TeX. Second, (La)TeX is really biased toward printed output. So what normally happens is that your tools generate the SGML, then transform that to the format appropriate for the target audience: (x)HTML or pdf for the web or Unix, microsoft .hlp files for Windows, and (La)TeX for printing or to generate a pdf of a printed document, because (La)TeX produces gorgeous printed output. XML, of course, is just S-expression with a *really* ugly syntax. So using LISP languages for generating it is easy and natural. > either by run (A) Clojure scripts from (La)TeX documents > and use Clojures output to generate document's content. This > can be used to read/convert data, generate tables and figures, > do on-the-fly calculations. I don't think anyone has done anything like this. Then again, most people don't use (La)TeX as an authoring language. > or by (B) implementing a clojure-based DSL that can produce > (La)Tex documents. Given a clojure-based DSL that produces SGML, there are a number of SGML applications that can be used to generate (La)TeX documents. Further, they can also produce things that more people are interested in, interactive web documents. The (La)TeX bias towards print bites you if you want interactive documents, as print is a miserable medium for them. People wanting to do them tend to use (x)HTML, because - well, it's design has been driven by two groups of people: One set wanted a good language for doing document processing, and they wrote the standards. Another set wanted a good language for doing network presentation, and they wrote the most popular code. The net result is a language in which it's possible to do good document processing if you want to (though 95% of the people producing web pages don't know that such a thing exists, much less have any ability to produce it), but it *also* has hooks to let you build complete applications in the document, should you want to. There are a number of efforts under way to provide clojure-based tools of either type A or B as you described - at least for some SGML applications. Most of them are aimed at the application-building side of things (mine included). Actually, I haven't looked for any aimed at more general document preparation, but going from an (X)HTML DSL to an SGML one that used docbook shouldn't be that hard. You can read about my DSL for XHTML - though it's set up to make it easy to create a DSL for an arbitrary XML schema - at http://mired.wordpress.com/tag/web/. Unfortunately, it's a blog, so the justification for what's near the top is found at the bottom.... <mike -- Mike Meyer <m...@mired.org> http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. O< ascii ribbon campaign - stop html mail - www.asciiribbon.org -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en