[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Use of SGML for documentation (Re: potato -> woody upgrade not smooth...)



(not subscribed to debian-sgml, please CC)
On Sun, Jul 08, 2001 at 04:16:09PM +0200, Michael Koehne wrote:
> Moin Matthew Danish,
> 
> > I cooked up a quick example for you... see the 3 attached files.
> 
>   nice idea. And it shows that LISP syntax is as fine to represent hirachical
>   data as are XML and SGML syntax.
>   
>   LISP, in this case, is only syntax and free of semantics. This is similar
>   to XML & SGML and a difference to LaTeX, roff or HTML. Semantics is a
>   different can of worms. Its provided by document type definitions like
>   QWERTZ, LinuxDoc, DocBook, DebianDoc or XML-Edifact.
My set of LISP macros is providing my document type definition.

> 
>   The third leg is processing. Your example showed that you have a kind
>   of processing to map LISP to DebianDoc. And here markup languages show
LISP macros.

>   abstraction. You can process SGML or XML into many other formats using
>   nearly any language you want. And at this point XML and SAX or SGML and
>   Amsterdam SGML Parser are superior to your LISP example. Your LISP code
Those parsers are huge and complex.  Anyone can embed a LISP (or Scheme)
interpreter into their program.  And judging by the sheer number of toy
Scheme interpreters out there, it's pretty easy to write one.

>   has to parsed into memory, and shares the same drawback as XML/DOM or
>   most XSLT processors, if you think about EDI documents in megabyte size.
> 
>   My point here is that SGML and XML are only syntax and abstract to
>   semantics or processing. This is a feature, imho, as it allows to
>   chose best fit semantics and best fit processing for your type of
>   documents.
And LISP is a data format that can represent programs that can twist
and turn that data however you like.

> 
>   Other document formats like HTML, LaTeX, roff are bound to their
>   sememantics and to a single tool to process them. So SGML or XML
>   are good for any kind of hirachical data and can be processed into
>   many formats using many differenct programming languages and design
>   patterns.
XML is "good" for many different kinds of programming languages for the
same reason that Java is "good" for many different kinds of platforms;
someone took the time and effort to write all the implementations for it.
That doesn't mean that Java, or XML, is inherently "better" for this kind
of application, it's just one way of doing it.

If this hasn't already been done, it wouldn't take too much to write
a set of macros which load my "Document definition macros" which
provide a document syntax akin to examples I've already provided.  I
just don't have the time right now.

So correct me if I'm wrong, but I don't recall anything like the LISP macro
facility in XML.  And while poking around google to find out if this
is indeed so, I came across a truely disturbing web page:
http://www.w3.org/TR/xexpr/
Which purports to provide a programming language with XML syntax so that
JavaScript is not needed (strike 1!).

For example:

<define name="factorial" args="x">
 <define name="iterator" args="product counter max">
  <if>
   <gt><counter/><max/></gt>
   <product/>
   <iterator>
    <multiply><counter/><product/></multiply>
    <add><counter/>1</add>
    <max/>
   </iterator>
  </if>
 </define>

 <iterator>1 1 <x/></iterator>
</define>

That is truely disgusting, especially when you can write this:

(defun factorial (x)
  (labels ((iterator (product counter max)

		     (if (> counter max)
		         product
		      (iterator (* counter product)
				(+ counter 1)
				max))))

     (iterator 1 1 x)))

And still have all the power of data-representation and more.

(That should be the exact same thing in LISP, if I understood the nasty XML
syntax correctly.)

This is why a lot of LISP programmers don't take XML seriously.  It lacks
macros, and it lacks an object system (Google returned an example of someone 
rewriting a LISP-based object oriented data syntax in favor of an XML syntax 
that lacked that capability ... smells like buzzword-compliance to me); one of 
my friends plans to write a document system in LISP that uses the Common LISP 
Object System (think "memo inherits from letter" or similar).  It also 
apparently lacks a decent interpreter (eval), judging from the need for 
JavaScript or X-exprs.

So XML (and these nasty X-exprs too) is doing a fine job... of reinventing 
the same old concepts that have been part of LISP for the past several decades.

And that's why I made that one sidenote comment which started this whole
discussion.

> 
> Bye Michael
> -- 
>   mailto:kraehe@copyleft.de             UNA:+.? 'CED+2+:::Linux:2.2.18'UNZ+1'
>   http://www.xml-edifact.org/           CETERUM CENSEO WINDOWS ESSE DELENDAM

-- 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Matthew Danish                         email: mdanish@andrew.cmu.edu ;;
;; OpenPGP public key available from:        'finger mrd@db.debian.org' ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



Reply to: