3 ms·
Executable config can bring huge wins. Python is an obvious choice. Just say, I'm going to run your script in a Python interpreter (in heavily limited cgroup) a
by globular-toast 3y ago
Executable config can bring huge wins. Python is an obvious choice. Just say, I'm going to run your script in a Python interpreter (in heavily limited cgroup) and your script must result in a dictionary called CONFIG. Some wrapper logic could then serialise that in whatever way is convenient for the program under configuration.
- kuchenbecker 3y agoDeclarative vs imperative. Languages have state and behavior. I've had to convert 50k class-based schemas to a declarative DSL; the requirement is to be declarative, not rely on external state. and portable as-is with as little interpretation as possible. The flexibility of a language means some bug deep in a library will cause your infra to delete or misconfigureitself on accident. An API requires transactions or at the very least a read-modify-write cycle. The API need to always be up so engineers can merge their modifications to infrastructure. Recovery and undo is also a problem that needs to be solved so you need a system with point in time recovery. My Preference is to have an actual language generate what the system will do in a human-readable format, and you check that in, but Git and JSON or YAML with a Proto DSL act as the API, and then anything that can write a flat file can be used to configure your system.
- globular-toast 3y agoYeah, but we're adults and just because we can do something doesn't mean we have to. You can write shit code and you can write shit configs. Python can be written in a declarative style with perhaps a little magic sprinkled when pragmatic to do so. Completely banning imperative programming is like throwing out the baby with bath water.
- verdverm 3y agoSo add python as a dependency to every project?
- globular-toast 3y agoIf the project could benefit from such a configuration, why not? It's not a super heavy dependency and most distros include it by default. Obviously doesn't make sense for every project, but something like a CI system or desktop window manager, sure.
- verdverm 3y agoit means every non-python project now has to do pip, venv, and more, not just installing python, because you have to add a non-stdlib package And not everyone uses or knows python... So yes, this is a significant ask and lift for most projects.