-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
binary format support? #80
Comments
I don't see any problems with this request other than the binary representation (1) would not be stable between releases pre-1.0 (i.e. #59), and (2) would not be compatible with the binary representation of other CEL runtimes. I need to find a binary format that can express the Expression enum, but I imagine postcard or bincode. |
I think the spec even defines a format for expressions: https://github.com/google/cel-spec/blob/f027a86d2e5bf18f796be0c4373f637a61041cde/proto/cel/expr/syntax.proto#L40 Not sure if the goal is to have a binary representation that's compatible across different CEL libraries, the spec is a bit squishy on that… |
I could have sworn that cel-go said they were moving away from the heavy dependency on protobufs for everything. But I could be making that up. In any case, changing the binary format for expressions would be a pretty heavy change in this project, for something that (as you say) isn't strictly required, and for a use-case (compatibility across runtimes) that may not be extremely common. I could be wrong though, and am happy to hear use-cases where consistent binary formats are important. |
I opened google/cel-spec#385 to clarify that part of the spec. Maybe there's value on having a standardized compact exchange format that can work across different implementations, but it might not need to be the same as the internal data format of course. |
We heard back, sending a protobuf-encoded version of the AST "to send CEL programs over the wire" seems to be a valid exchange format. So I think it'd make sense if we could render a parsed expression out as such a proto, and parse them back in. Maybe behind a feature flag, so you can disable it if someone doesn't use this functionality and doesn't want to pull in prost into their dependency tree? |
Thanks for confirming this! A feature flag and a |
I took a first stab at this, can be found in the The data model is a bit different compared to what I'm not sure how soon I'll be able to get back to this, but I wanted to at least get the plumbing pushed out, so it's just the implementation now :-) |
Thank you! I'll put some cycles into adding the type conversions. |
Thanks! With me having opened the draft PR, you should be able to push to the branch. Or just cherry-pick into one of yours :-) |
I'd like to pass a more concise version of CEL expressions.
https://github.com/google/cel-spec mentions:
It currently looks like the only way to use this library is using
Program::compile
, passing the textual representation.The result is not serializable currently (so we cannot persist it anywhere to survive a program restart), and it seems it's also not possible to pass a more binary form to there either.
Do you plan to add support for this?
The text was updated successfully, but these errors were encountered: