4 ms·
Config as code is basically the default for (Python) Django applications, but for compiled language you would need to bake in a scripting engine or something.
by packetlost 3y ago
Config as code is basically the default for (Python) Django applications, but for compiled language you would need to bake in a scripting engine or something. There's always sqlite, which is almost everywhere and very fast.
- mkl 3y agoLua is used quite a bit for that purpose, as it's small and easy to embed. I'm not a Lua programmer, but bodging together a few snippets of Lua with a well-defined configuration API is much easier than trying to do that with SQLite statements.
- thadt 3y agoIndeed. About 15 years ago I picked up Lua for exactly that purpose on an embedded device that needed a somewhat sophisticated configuration. Readable. Comments included. If/else for a few things when needed. Was the best configuration experience I've had before or since.
- packetlost 3y agoLua is a fantastic embedded language! I'm partial to Lisps/Schemes for this purpose, EDN/S-Exprs are pretty good config formats as well.