Raw capture โ raw/celly.md
url: https://www.nuget.org/packages/Celly title: Celly โ Native C#/.NET Implementation of Common Expression Language (CEL) author: bsidio date_fetched: 2026-07-18 date_published: 2026-07-17
A native C#/.NET implementation of Google's Common Expression Language (CEL). Written from scratch in pure managed C# โ no WASM shims, no Go-compiled artifacts, no native library bindings.
Version: 1.2.0 (2026-07-18) | License: Apache-2.0 | Target: .NET 8.0+ Repository: https://github.com/bsidio/celly Documentation: https://bsid.io/celly/
1.0 stable โ public API with snapshot testing, 100% conformance, and fuzz-hardened.
Passes 2,456 / 2,456 (100%) of the official cel-spec conformance suite, spanning 30 test data files pinned at commit 59505c1, verified in CI across Linux, Windows, and macOS. A ratcheting skip-list (known-failures.txt) is now empty.
The conformance suite also runs strong_* enum sections with Celly's strong-enum mode.
Described as "the fastest .NET CEL implementation":
- ~1.2ร faster than Cel.NET
- ~6โ9ร faster than TELUS's Cel package
- Far lower memory allocation than competitors
- Within ~1.2ร of the reference Go implementation (cel-go) on simple expressions
- Faster than cel-go on comprehension-heavy expressions
| Package | Contents | Key Dependency |
|---|---|---|
| Celly | Core: lexer, parser, macros, type checker, evaluator, standard + extension libraries | None |
| Celly.Protobuf | Protobuf types, well-known types, enums, proto2 extensions | Celly, Google.Protobuf |
| Celly.Protovalidate | protovalidate for .NET โ validates messages against buf.validate rules |
Celly, Celly.Protobuf, Google.Protobuf |
Celly.Protovalidate passes 2,872 / 2,872 (100%) of buf's official protovalidate conformance suite.
Zero-dependency core containing the lexer, parser, macros, type checker, evaluator, standard library, and all extension libraries.
size/in/indexing, all type conversions with Go-compatible formatting, RE2-semantics matches() via .NET's linear-time NonBacktracking engine, nanosecond-precision timestamps/durations with IANA timezone accessorshas, all, exists, exists_one, map, filter plus two-variable comprehensionsdyn, parameterized-type unification, container (C.name) resolution, comprehension-variable shadowing per specoptional.of/ofNonZeroValue/none, a.?b, a[?b], [?e], {?k: v}, orValue, optMap/optFlatMapNativeTypeProviderEvalLimits) and static cost estimation (CelEnv.EstimateCost)CelEnv and CelProgram are immutable; programs are safe for concurrent evaluationvar env = CelEnv.Create(new CelEnvSettings
{
Declarations =
[
new VariableDecl("request", CelType.Map(CelType.String, CelType.Dyn)),
],
});
var program = env.Compile("request.user.startsWith('admin-') && size(request.groups) > 0");
var result = program.Eval(new Dictionary<string, object?>
{
["request"] = new Dictionary<string, object?>
{
["user"] = "admin-alice",
["groups"] = new[] { "ops" },
},
});
CEL is the expression language behind Kubernetes admission policies (ValidatingAdmissionPolicy), Envoy RBAC, Google Cloud IAM conditions, gRPC protovalidate, and more. Official implementations exist for Go, C++, Java, and Rust but not .NET โ which Celly fills.
Versions: 0.1.0 (37), 0.2.0 (35), 0.3.0 (37), 1.0.0 (31), 1.1.0 (34), 1.2.0 (0)