3 ms·
Instead of inventing your own syntax, why didn't you use a portable syntax like XML, JSON, YAML, or better yet, libconfig[1]? Please compare the libconfig test
by mahmud 16y ago
Instead of inventing your own syntax, why didn't you use a portable syntax like XML, JSON, YAML, or better yet, libconfig[1]?
Please compare the libconfig test file to the mongrel configuration file:
http://www.hyperrealm.com/libconfig/test.cfg.txt http://www.hyperrealm.com/libconfig/test.cfg.txt
http://mongrel2.org/doc/tip/docs/manual/book.wiki#x1-190003.3 http://mongrel2.org/doc/tip/docs/manual/book.wiki#x1-190003....
The mongrel conf is a subset of libconfig; it doesn't use the more advanced features. Plus libconfig has bindings and versions of it in nearly every mainstream language.
[1]http://www.hyperrealm.com/libconfig/libconfig.html http://www.hyperrealm.com/libconfig/libconfig.html
- alexgartrell 16y agoThe mongrel2 configuration architecture makes it pretty easy to write a libconfig configuration shell. All it would need to do is translate the libconfig stuff to sqlite. If using libconfig is a good idea, it'll win. P.s. imho, this is the cool thing about the Mongrel2 stuff. The good ideas can always win, because there really just isn't a whole lot to Mongrel2-core, and everything else is decoupled.
- deleted 16y ago[deleted]
- zedshaw 16y agoI thought about something like that, but wanted to duplicate the existing config file format so that people's configs would keep working (mostly). It actually had some cool advantages, like a nice psuedo variable system letting you setup variables for reuse in different parts of the config file. I haven't really seen that in other config formats, and it is damn handy.
- mahmud 16y agolibconfig has include directives, is far more useful to multi-instance setups. Plus you get a full type system, all in a 33k binary.
- thaumaturgy 16y agoI do that in the readable config file format I wrote for another web backend, and it is hella useful.
- pygy_ 16y agoYAML has a variable system: http://www.yaml.org/spec/1.2/spec.html#id2786196 http://www.yaml.org/spec/1.2/spec.html#id2786196