[zeromq-dev] Devices and config files

Andrew Hume andrew at research.att.com
Tue Aug 24 14:50:51 CEST 2010


if i might offer a counterpoint.

most people find explicit scopes easier to work with,
rather than, say, subtle indentation based stuff.
(python has succeeded as far as it has DESPITE indentation, not  
because of it.)

for example, i manage my many RAIDs with a config file that looks like

storage tc00 {
         default fs=xfs
         default access=rw
         default mountpoint=/l

         dev rmfs0001 { ctlr=0 node=ant10 }
         dev rmfs0002 { ctlr=1 node=ant11 }
}

storage pk04 {
         default fs=ufs
         default access=rw
         default mountpoint=/l

         dev rmfs0313 { ctlr=0 node=kow20 }
         dev rmfs0314 { ctlr=0 node=kow20 }
         dev rmfs0315 { ctlr=0 node=kow20 }

         dev rmfs0310 { ctlr=1 node=kow21 }
         dev rmfs0311 { ctlr=1 node=kow21 }
         dev rmfs0312 { ctlr=1 node=kow21 mountpoint=/l/ng_scr00 }
}

the semantics are unimportant, although i'd bet most readers on this  
list could figure 90% out
just by looking at it. sure, the tab indent helps readability, but  
the '{}' are easier to determine scope.
everything is strings internally, but insisting on quotes would  
probably be cleaner.

by the way, i use the ruby treetop parser to parse this language, but  
writing a C version would be trivial.

one last point: please make these files easy to machine-generate.  
(this is likely the most tedious
part of indenting-based schemes.) i find i am almost always finding  
ways to generate most of my config files
automatically from other sources.

		andrew

On Aug 24, 2010, at 8:18 AM, Pieter Hintjens wrote:

> On Tue, Aug 24, 2010 at 2:02 PM, gonzalo diethelm  
> <gdiethelm at dcv.cl> wrote:
>> Ok. Any pointers yet?
>
> Here is a sketch.  http://rfc.zeromq.org/spec:4
>
> Basically it's stripped down to the minimum, and should be parsable
> with simple code.  With regexps, trivial.  Without, a little more work
> but nothing as complex as XML or JSON.
>

------------------
Andrew Hume  (best -> Telework) +1 732-886-1886
andrew at research.att.com  (Work) +1 973-360-8651
AT&T Labs - Research; member of USENIX and LOPSA



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20100824/cb6bcce7/attachment.htm>


More information about the zeromq-dev mailing list