GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - cel-expr/cel-spec: Common Expression Language -- specification and binary representation

BranchesTags
Open more actions menu

Latest commit

 

History

358 Commits
358 Commits

Folders and files

NameName
Last commit message
Last commit date
.bcr
.bcr
 
 
.github/workflows
.github/workflows
 
 
conformance
conformance
 
 
doc
doc
 
 
proto
proto
 
 
tests
tests
 
 
.bazelversion
.bazelversion
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
BUILD.bazel
BUILD.bazel
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
GOVERNANCE.md
GOVERNANCE.md
 
 
LICENSE
LICENSE
 
 
MAINTAINERS.md
MAINTAINERS.md
 
 
MODULE.bazel
MODULE.bazel
 
 
README.md
README.md
 
 
WORKSPACE
WORKSPACE
 
 
WORKSPACE.bzlmod
WORKSPACE.bzlmod
 
 
checked.pb.go
checked.pb.go
 
 
cloudbuild.yaml
cloudbuild.yaml
 
 
eval.pb.go
eval.pb.go
 
 
explain.pb.go
explain.pb.go
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
regen_go_proto.sh
regen_go_proto.sh
 
 
regen_go_proto_canonical_protos.sh
regen_go_proto_canonical_protos.sh
 
 
syntax.pb.go
syntax.pb.go
 
 
value.pb.go
value.pb.go
 
 

Repository files navigation

Common Expression Language

The Common Expression Language (CEL) implements common semantics for expression evaluation, enabling different applications to more easily interoperate.

Key Applications

  • Security policy: organizations have complex infrastructure and need common tooling to reason about the system as a whole
  • Protocols: expressions are a useful data type and require interoperability across programming languages and platforms.

Guiding philosophy:

  1. Keep it small & fast.
    • 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.
  2. Make it extensible.
    • CEL is designed to be embedded in applications, and allows for extensibility via its context which allows for functions and data to be provided by the software that embeds it.
  3. Developer-friendly.
    • The language is approachable to developers. The initial spec was based on the experience of developing Firebase Rules and usability testing many prior iterations.
    • The library itself and accompanying toolings should be easy to adopt by teams that seek to integrate CEL into their platforms.

The required components of a system that supports CEL are:

  • The textual representation of an expression as written by a developer. It is of similar syntax to expressions in C/C++/Java/JavaScript
  • A representation of the program's abstract syntax tree (AST).
  • A compiler library that converts the textual representation to the binary representation. This can be done ahead of time (in the control plane) or just before evaluation (in the data plane).
  • A context containing one or more typed variables, often protobuf messages. Most use-cases will use attribute_context.proto
  • An evaluator library that takes the binary format in the context and produces a result, usually a Boolean.

For use cases which require persistence or cross-process communcation, it is highly recommended to serialize the type-checked expression as a protocol buffer. The CEL team will maintains canonical protocol buffers for ASTs and will keep these versions identical and wire-compatible in perpetuity:

  • CEL canonical
  • CEL v1alpha1

Example of boolean conditions and object construction:

// Condition
account.balance >= transaction.withdrawal
    || (account.overdraftProtection
    && account.overdraftLimit >= transaction.withdrawal  - account.balance)

// Object construction
common.GeoPoint{ latitude: 10.0, longitude: -5.5 }

For more detail, see:

  • Introduction
  • Language Definition

Released under the Apache License.

About

Common Expression Language -- specification and binary representation

cel.dev

Resources

Readme
Apache-2.0 license

Code of conduct

Code of conduct

Contributing

Contributing
Activity
Custom properties

Stars

4.1k stars

Watchers

49 watching

Forks

312 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.