[zeromq-dev] Devices and config files
gonzalo diethelm
gdiethelm at dcv.cl
Tue Aug 24 15:39:08 CEST 2010
This looks similar to the property lists used in the Mac world (the
NeXTSTEP flavor). This format could be a good choice because it is a
"standard"; for instance, Apache Commons Configuration (in the Java
world) can read parameters defined in property lists, among a whole set
of other sources such as INI files, XML files, a JDBC data source, etc.
http://en.wikipedia.org/wiki/Property_list
Gonzalo Diethelm
________________________________
From: zeromq-dev-bounces at lists.zeromq.org
[mailto:zeromq-dev-bounces at lists.zeromq.org] On Behalf Of Andrew Hume
Sent: Tuesday, 24 August, 2010 08:51
To: 0MQ development list
Subject: Re: [zeromq-dev] Devices and config files
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/013be05e/attachment-0001.htm>
More information about the zeromq-dev
mailing list