From owner-freebsd-chat Tue Jan 28 05:37:55 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id FAA14320 for chat-outgoing; Tue, 28 Jan 1997 05:37:55 -0800 (PST) Received: from chai.plexuscom.com (chai.plexuscom.com [207.87.46.100]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id FAA14302; Tue, 28 Jan 1997 05:37:50 -0800 (PST) Received: from chai.plexuscom.com (localhost [127.0.0.1]) by chai.plexuscom.com (8.8.4/8.6.12) with ESMTP id IAA11782; Tue, 28 Jan 1997 08:38:38 -0500 (EST) Message-Id: <199701281338.IAA11782@chai.plexuscom.com> To: Warner Losh Cc: Michael Smith , chat@freebsd.org, config@freebsd.org Subject: Re: Kernel config metasyntax In-reply-to: Your message of "Mon, 27 Jan 1997 21:29:43 MST." Date: Tue, 28 Jan 1997 08:38:37 -0500 From: Bakul Shah Sender: owner-chat@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > (option 'DDB :description "blah" :type 'boolean) > (option 'DDB_PANIC_REBOOT :description "blah blah" :type 'boolean > :depends-on 'DDB) > which would be just a simple eval in lisp :-) (-: :-) > However, no matter what the language, I'm all for doing things as > easily as possible, and if that is TCL, then go for it. As you may > guess, I've been left with a bad taste in my mouth for TCL over the > years, so I tend to react negatively to it. If others thing that it > is the way to go, and they are the ones writing the config tools, then > my likes and dislikes really don't matter. I am with Warner on this one. Syntax of a language is the least of one's worries (except when it gets in the way). The hard part is pinning down consistent semantics. Also, languages tend to grow and its uses evolve. Someone else may have to extend it later. For all these reasons, whether one uses YACC+C or TCL or Lisp or Prolog, it would make sense to first define the semantics: - What do you want the config language to be? - What objects and relationships should it describe? (e.g. busses, IO-devices, drivers, parameters, subsystems ...) - Can the language describe the *complete* set of objects and relationships for existing configurations? - Can you come up with rules that future configurations are *likely* to fit in? For example, rather than enumerating all the possible objects of interest, can you come up with a `type' object and ways to define new types? - Do you need to embed bits of C code (e.g. for generating param.c, config.c, ioconf.c) or do you need to use some `magic' rules? - Can the language be `declarative' as opposed to `algorithmic'? The former is easier to use, the latter easier to implement. - Can you make do with a smaller language? Can an existing language be used as a starting point or base? One doesn't have to be formal/anal about this process but it helps to be aware of it. At the very least I would start with defining config objects of interest and their relationships if I were doing this. BTW, Prolog may make a pretty good fit for a configuration language (or a model for it) since it can compactly describe relationships. My 2 cents -- bakul