Earlier quoted context omitted.
I'm an ardent supporter of executable config languages, especially for the infrastructure-as-code space (the only thing special about this space is that configs tend to be very large, so you're more likely to run into reuse issues), which markets itself as "it's just YAML!" but inevitably all of that copy/pasted YAML becomes unwieldy and you want reusability. At that point, you have a few distinct options: 1. Build a…
I am with you, I wish the world would just adopt Lua as their config files.
Common Expression Language
11–20 of 111 posts
Re: Common Expression Language
#12At the end of the README: Disclaimer: This is not an official Google product.
Re: Common Expression Language
#13I’m curious how this differs from Sentinel, hashicorps language for similar things. Too bad it isn’t open sourced. https://www.hashicorp.com/sentinel
Re: Common Expression Language
#14This looks really similar to Open Policy Agent[0], wonder how they compare. [0]: https://www.openpolicyagent.org/
I left the team about that time, so I don't know what exactly happened after that, but I wouldn't be surprised if the two are fairly close. My assumption is that's why CEL is polished up and OSS (I think we first published it a few years ago, why'd it get posted now?)
Re: Common Expression Language
#15Don't expect your config files to terminate when they use macros, that's all I'm saying.
Re: Common Expression Language
#16I remember seeing this used inside config files for the Caddy webserver. Google seem to like these executable config languages because they've got another open source one ("Starlark") a few notches up in expressivity.
"CEL evaluates in linear time, is mutation free, and not Turing-complete. This limitation is a feature of the language design, which allows the implementation to evaluate orders of magnitude faster than equivalently sandboxed JavaScript."
As mentioned, the goals are security policies (it was first used internally as the Security Rules for Cloud Storage for Firebase and the Cloud Firestore) and proto contracts (e.g. you could define addons to your proto to specify the data matched certain behavior):
I forget the exact syntax for the contract, but it looked something like this...
``` message person { @contract(matches(/* RE2 phone number regex */)) string phone_number = 1; ... } ```
That data could enforce client side checks as well as be used server side (in different implementation languages).
I always wanted to see it combined with the proto to Firebase Security Rules generator (https://firebaseopensource.com/projects/firebaseextended/pro...) to do client and server validation.
Re: Common Expression Language
#17At the end of the README: Disclaimer: This is not an official Google product.
I'm a Googler, opinions are my own. A lot of the times engineers at Google will open source libraries or tools they have worked on, which go under the Google GitHub repo, but are attached with that language. This is basically saying that it is owned by Google but it is not something Google is officially supporting. It may continue to get updates, it may not. I've definitely seen some libraries open sourced from Googl…
Re: Common Expression Language
#18Re: Common Expression Language
#19I'd be a bit suspicious about the claim that it is not Turing complete. To be fair I can't yet find a way to allow arbitrary computation (though it seems easy to add one with fairly innocuous features). Although you can get it to solve 3-SAT, though only for some predefined number of variables (which it assures can be at least 32). Combinatorics stuff like printing all possible sudokus also seems like it should be fe…