From owner-freebsd-arch Wed Feb 12 12:38:29 2003 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B304E37B401 for ; Wed, 12 Feb 2003 12:38:26 -0800 (PST) Received: from thunderer.cnchost.com (thunderer.concentric.net [207.155.252.72]) by mx1.FreeBSD.org (Postfix) with ESMTP id EC85A43FB1 for ; Wed, 12 Feb 2003 12:38:25 -0800 (PST) (envelope-from bakul@bitblocks.com) Received: from bitblocks.com (adsl-209-204-185-216.sonic.net [209.204.185.216]) by thunderer.cnchost.com id PAA00115; Wed, 12 Feb 2003 15:38:21 -0500 (EST) [ConcentricHost SMTP Relay 1.15] Message-ID: <200302122038.PAA00115@thunderer.cnchost.com> To: Garrett Wollman Cc: Wes Peters , arch@FreeBSD.ORG Subject: Re: syslog.conf syntax change (multiple program/host specifications) In-reply-to: Your message of "Wed, 12 Feb 2003 11:15:39 EST." <200302121615.h1CGFdGG025691@khavrinen.lcs.mit.edu> Date: Wed, 12 Feb 2003 12:38:20 -0800 From: Bakul Shah Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > eschew is a proliferation of lots of little languages, each one subtly > different, such that users are forced to learn all of them. We > already have: [list deleted] > Every single one of these has a different syntax that the admin must > learn in addition to the relevant semantics, and which any sort of > front-end or configuration-analysis tool must be able to interpret, in > order to do anything useful with the programs they control. The > benefit of something like XML (or Lisp, for that matter) is that, You have my vote for a Lisp syntax (s-experessions). S-exprs are quite readable and lightweight -- you can't go lighter than s-exprs and still have a universal structured data representation. And you can parse them with a couple of hundered lines of C code (without having to worry about any buffer overflows or limits except the system imposed ones). > Yes, XML syntax is pretty hateful -- but because it is lexically > regular, my editor can do much of the work for me. It can do even > more of the work when the XML is coupled with a DTD so that it > understands more of the structure. In my view XML is to data representation what Roman numerals are to math. You _can_ do math in Roman numerals but people didn't do much for many centuries. The "syntax" must have overwhelmed them:-) A notation should encourage, not stifle, expression of ideas. At any rate XML is just another data representation language de jour. Likely, it will replaced by another one (and another) and all the lemmings will go over _that_ cliff. s-exprs been around for over 40 years without "evolving" significantly. Rather than repeat all the arguments I'll point you to what knowledgeable people like Erik Naggum have to say about XML (search comp.lang.lisp on groups.google.com). Naggum used to be a strong proponent of SGML until he "saw the light"! A couple of recent thread on XML on comp.lang.lisp are worth browsing. Another view is to not get tied too closely to the actual representation but standardize on a procedural interface. Then one can choose different representations depending on the context (e.g. when you have 10 accounts, use of a btree database for /etc/passwd is foolish; when you have 10000 accounts, use of a linear list is foolish -- but client programs of /etc/passwd should *not* need to be recompiled if the representation is changed). Yet another but related view is to extend the known interface of files and directories to configuration as they are the only truly first class objects in unix (in terms of programs that understand them). Pretty much every config file you mentioned but particularly files with simple and nested parameters naturally fit this paradigm. For instance, /etc/rc.conf would be a directory, files within it name specified parameters and their contents if any are their values. It is natural to "union mount" /etc/defaults/rc.conf _under_ it. Similarly, a kernel config can be a directory. Subsystems can be subdirectories and so on. Specific derived kernel confs can be union mounted on atop of that. But I guess that way lies plan9. -- bakul PS: The following Alan Perlis epigrams seem apropos. Fools ignore complexity. Pragmatists suffer it. Some can avoid it. Geniuses remove it. It is better to have 100 functions operate on one data structure than 10 functions on 10 data structures. Simplicity does not precede complexity, but follows it. Functions delay binding; data structures induce binding. Moral: Structure data late in the programming process. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message