Using Directories as Configuration Fomats - Programming On Unix
Users browsing this thread: 2 Guest(s)
|
|||
The OpenBSD approach is to have one language per configuration format, using a common lexer (.c code written by hand but similar across programs, splitting keywords and special characters), but specific parser (using yacc).
The advantage is to have a single file, with macro (var = "xxx"), include support, and a syntax efficient for the actual format to read. OTOH, this requires YACC. The DJB Way [1] is to have multiple files, closer to what you zge seems to be doing, but each file still a "table", that containt the bulk of the data (like in http://cr.yp.to/djbdns/tinydns-data.html), or individual (like in the various qmail-* programs, each reading a subset of /var/qmail/control/* files). Then, there are more formal syntax, like .ini, .json, .toml, .yaml (;_;), .hcl... That are built like a tree, or programing languages (.h header file to recompile, external conf.lua for project in C, .py for .py project...). I had this idea that a configuration built like a tree could continue the filesystem tree: If /etc/myprog/test.json is a file, /etc/myprog/server/runners/memory would open that file then go to ."server"."runner"."memory" within json (jq syntax). If /etc/myprog/test/server is a file, /etc/myprog/server/runners/memory would open that file then go to ."runner"."memory" with json (jq syntax). |
|||
Messages In This Thread |
Using Directories as Configuration Fomats - by pkal - 11-09-2019, 01:19 PM
RE: Using Directories as Configuration Fomats - by budRich - 11-09-2019, 10:53 PM
RE: Using Directories as Configuration Fomats - by Halfwit - 12-09-2019, 02:07 AM
RE: Using Directories as Configuration Fomats - by pkal - 12-09-2019, 03:54 AM
RE: Using Directories as Configuration Fomats - by budRich - 12-09-2019, 01:45 PM
RE: Using Directories as Configuration Fomats - by z3bra - 12-09-2019, 07:28 PM
RE: Using Directories as Configuration Fomats - by Halfwit - 13-09-2019, 12:09 AM
RE: Using Directories as Configuration Fomats - by pkal - 13-09-2019, 05:38 AM
RE: Using Directories as Configuration Fomats - by josuah - 12-01-2020, 08:54 PM
RE: Using Directories as Configuration Fomats - by josuah - 12-01-2020, 09:05 PM
|