Skip to content
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

Dispatcher refactor to improve function declaration, definition, and extension #556

Merged
merged 2 commits into from
Jun 28, 2022

Conversation

TristonianJones
Copy link
Collaborator

@TristonianJones TristonianJones commented Jun 22, 2022

This change introduces a top-level cel.Type as well as functional options for configuring cel.Variable and cel.Function definitions using go-native APIs.

This change is a shift away from the existing protobuf APIs which is also provides the following improvements:

  • Automatic generation of function overload type-guards to provide basic invocation protections
  • Automatic generation of dynamic dispatch functions for resolving overloads at runtime (for both parse-only expressions and dynamically typed data)
  • Ability to declare and define functions within a single context.

The only drawback of this approach is that there is some minimal invocation overhead for functions declared/defined in this manner. Future optimizations may permit users to disable such type-guards if they deem them not to be necessary.

As a follow up PR, the ext function libraries and CEL standard operators will be shifted over to this new declaration style to improve the ease of extension of the core library implementations.

This is the basis for the feature requested in #493

@TristonianJones TristonianJones requested a review from jcking June 22, 2022 22:46
…go-native API while enhancing dispatch capabilities in CEL
@TristonianJones TristonianJones merged commit c10af62 into google:master Jun 28, 2022
@TristonianJones TristonianJones deleted the dispatch-refactor branch June 28, 2022 18:47
@TristonianJones TristonianJones mentioned this pull request Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants