3 ms·
turing complete configuration? no thanks. i like it when my configs are guaranteed to halt.
by baq 6y ago
turing complete configuration? no thanks. i like it when my configs are guaranteed to halt.
- osmarks 6y agoFair, and there's this neat Dhall (https://dhall-lang.org/ https://dhall-lang.org/) thing for config files (not really this, since it seems like it is designed to actually encode some amount of logic) which enforces that while still being pretty programmable. This might actually already be TC, though; at the very least it is able to do infinite loops.
- SomaticPirate 6y agoDhall really feels like the future of configuration as code. It provides strong typing and outputs to a flat map. It’s still early though and the tooling is a bit ugly. You can embed enough logic that it feels usable. The biggest selling point for me was the typing though.
- zingplex 6y agoI've used Dhall in production, pushed it fairly hard and can say with utmost certainty it's be an absolute pleasure. We use it as our application configuration format and derive fairly intricate Kubernetes resources from our app config.
- Gravityloss 6y agoWe also use Dhall. The home page has a very nice intro indeed. https://dhall-lang.org/ https://dhall-lang.org/
- perfunctory 6y agowhat makes you think this yml language is not turing complete?
- osmarks 6y agoBased on skimming the docs there, you can do infinite loops but may have finite storage (strings are apparently <=64KB and there seems to not be a way to append to arrays). It does have subworkflows, so maybe you could store data in the callstack in some horrendous way, but it's probably also limited in size.
- gnulinux 6y agoBecause obviously you can do loops, it's even there in the example.
- ufo 6y agoIt is possible to use Lua hooks to protect against programs that accidentally take too long too run. Lua can be told to stop the script after so many steps. This technique isn't fool proof against maliciously crafted programs, but it might be sufficient depending on what you are doing.