6 ms·
I agree that it’s probably nicer than YAML, but that’s a low bar. I’m more interested in whether it’s nicer than something like Starlark (especially a hypotheti
by throwaway894345 5y ago
I agree that it’s probably nicer than YAML, but that’s a low bar. I’m more interested in whether it’s nicer than something like Starlark (especially a hypothetical statically typed Starlark).
- verdverm 5y agoThere is a significant theoretical difference. CUE aims to be turing-incomplete, so no programming. This is based on Marcel's experience writing borgcfg and GCL while at Google. The quote I really like is "wrap code in data, not data in code" It has a lot to do with readability, maintainability, and being able to write tooling to work with config or data. Think about building a query tool that can find everything in your config using a particular label. With CUE, it is likely to be a one-liner (once the query proposal is implemented)
- throwaway894345 5y ago> There is a significant theoretical difference. I agree, but I don't understand the value of the difference. > CUE aims to be turing-incomplete, so no programming You could satisfy this property with an imperative language that lacks recursion, unbounded loops, etc; however, I'm not convinced this property is very useful in practice. I've never worked anywhere where this was a real problem. > Think about building a query tool that can find everything in your config using a particular label. In an imperative configuration language, I would just `jq` the generated JSON. At least I think that's analogous to your suggestion?
- verdverm 5y agoMarcel does a great job of arguing the value of Turing incompleteness. I've collected his talks here: https://cuetorials.com/videos https://cuetorials.com/videos I cannot say it better than he has. JQ is close to how CUE would solve this. Both are different than an imperative config language, where you would recurse over data. For both JQ and CUE, you would provide a pattern matching "mask" of sorts. With CUE, you can also have a schema built into that mask and ensure that any transformations are still valid. You can also do the same with Yaml, so you get one tool and language to replace jq, yq, and jsonschema. Cue might actually get bounded recursion, the idea has been thrown around. It ought not invalidate the theory because it can be proved all the way down. You can simulate it today with comprehensions. I've built some structural helpers on the pattern here: https://github.com/hofstadter-io/cuetils https://github.com/hofstadter-io/cuetils