3 ms·
code as config is amazing. well can be, easily, it needs to be descriptive and composable. meaning it needs to be able to return data according to some schema.
by pas 2y ago
code as config is amazing. well can be, easily, it needs to be descriptive and composable. meaning it needs to be able to return data according to some schema.
the point is, that the problem again is the lack of a clear boundary between the gathering, assembling, ordering, calculating and validating the steps required to prepare/build/install/load/use/and-so-on and the actual execution of those steps.
Terraform, for example, has a plan and run phase.
And in general the fear of too many layers (and in-situ DSLs) leads to very brittle and extremely inconvenient "interfaces" (ie. GitHub and Ansible programming in YAML comes to mind)
...
Ideally build/packaging/setup steps themselves were written in a way that their reinterpretation[0] is easily possible. (So we don't need to litter the implementation with explicit hook points, etc.)
[0] basically using interfaces and the visitor pattern, or in an FP way via the https://blog.rockthejvm.com/free-monad/ https://blog.rockthejvm.com/free-monad/
- dwattttt 2y agoI think config _is_ the clear boundary between those gathering, ordering etc steps. The less expressive config is, the more regular and structured it is, and it becomes very easy to be descriptive and composable.
- pas 2y agofrom time to time config is just not willing to sit there in a list. it needs to be computed. just an example from a few days ago. someone needs to pull data from some remote service (maybe Vault), or generation of keys/entropy/etc. [0][1] of course this just means folks should wrap the whole thing in a program. but that's getting inefficient fast if every layer only accepts "env vars" or a plain JSON file. [0] https://github.com/nextauthjs/next-auth/pull/9638#issuecomment-2105161063 https://github.com/nextauthjs/next-auth/pull/9638#issuecomme... [1] https://github.com/nextauthjs/next-auth/pull/9638#issuecomment-2184292582 https://github.com/nextauthjs/next-auth/pull/9638#issuecomme...