Re: ANN: Etiquette: a protocol construction tool

Peter Seibel <[email protected]> 12 Sep 2003 16:09:48 -0700
Newsgroups gmane.lisp.clump
Message-ID <[email protected]>
Miles Egan <[email protected]> writes:

> Peter Seibel wrote:
> 
> >Actually where I was hoping to go with my questions was to use
> >BEEP--assuming it was using XML for configuration foo--as an example
> >of a place where I think Lisp could win big--when something uses nasty
> >piles of XML for configuration, a Lisp implementation can hide the XML
> >behind a still text-based, still programatic interface (as opposed to
> >having to write some whizzy GUI tool to hide the horror) in the form
> >of a simple s-exp based config file that maps to the XML or better
> >yet, in some cases, a set of macros that allow the user to define
> >things much more concisely.
> >
> Drifting a little further afield of the clump charter...
> 
> There seems to be an unspoken assumption in the lisp community that
> s-exprs are inherently superior to xml and most people would really
> prefer to deal with them instead of xml given the chance.

Well, I think that's crazy. If we know one thing, it's that non-Lisp
people get the screeming heebie jeebies from s-exps. Simply replacing
some XML gorp with isomorphic s-exps isn't doing anyone any favors
except a die-hard Lisp programmer who really knows how to make Emacs
tapdance over and around s-exps.

> I'm not so sure this is true. S-exprs certainly beat xml hands down
> as a programming language syntax but as a data syntax it seems like
> a much harder sell. Expat is lightweight enough that it's not that
> much of a burden to carry around and the slightly clunkier syntax is
> offset by familiarity & availability of tools.
>
> It's hard for me to imagine how anybody can see the whole
> xml/xpath/xslt/xquery dogpile as any kind of progress, but for just
> shooting structured data around xml's not *so* bad.

No, it's not terrible as a data format. The spot where *I* think it's
susceptible to an s-exp attack is where it's supposed to be
human-generated/human-edited and it verges toward programming. For
instance, in J2EE, you have to generate these XML "deployment
descriptors" that tell your app server how to wire together your EJBs.
They can't express that in Java because it'd be way to tedious. And
compared to just making up some random syntax, using XML is probably
sensical.[1] But since it's the programmer who has to produce these
things it seems annoying to have the format be something that's so
tedious to edit in a plain text editor.

If EJB's had been a Lisp thing, the deployment descriptor would just
be another part of the program, with appropriate DEFDEPLOYMENT macros
or whatever to make it nice and concise.

My point--such as it is--is that there are systems, such as Mozilla,
that are "programmed" partly in some Turing complete programming
language (Javascript or C++ in that case) and partly in declarative
XML. A Lisp version of such a system would be written in a single
notation and would feel more like just writing a program, not a
program and a big pile of configuration. All I can say for certain is
that appeals to me; my theory is that it might actually work to get
some people over their s-exp heebie jeebies if they are getting sick
of slogging through XML config files. But I'll shut up about the
theory until I have some software that is based on it.

-Peter

[1] Funny historical note: back in the day when I worked at WebLogic
and we were the first ones out with an implementation of EJB 1.0, the
EJB standard specified that there would be a deployment descriptor but
didn't say what form it would be in. Our syntax was a parenthesis-rich
pseudo s-exp syntax because it was easy to write a parser for. Of
course everybody hated it. ;-)

-- 
Peter Seibel                                      [email protected]

         Lisp is the red pill. -- John Fraser, comp.lang.lisp