Alder 1.0.2
See the version list below for details.
dotnet add package Alder --version 1.0.2
NuGet\Install-Package Alder -Version 1.0.2
<PackageReference Include="Alder" Version="1.0.2" />
<PackageVersion Include="Alder" Version="1.0.2" />
<PackageReference Include="Alder" />
paket add Alder --version 1.0.2
#r "nuget: Alder, 1.0.2"
#:package Alder@1.0.2
#addin nuget:?package=Alder&version=1.0.2
#tool nuget:?package=Alder&version=1.0.2
Alder: C# Expression Engine for .NET
An embeddable C# expression evaluator with compiler-style binding for CLR types.
Alder is an embeddable C# expression engine for .NET applications. It evaluates expressions and statement blocks against your host's CLR types through a compiler-style semantic pipeline: parsing, binding, validation, interpretation, optional delegate compilation, Dynamic LINQ adaptation, expression-tree export, execution limits, and generated dispatch for NativeAOT. Lambdas, query syntax, pattern matching, async, and iterators bind with ECMA-334 semantics. Both execution backends share the same parser, binder, security policy, and execution limits, and both produce identical results.
Highlights
- C# expressions and statements at runtime. Lambdas, queries, pattern matching, async, iterators, user-defined operators and conversions, evaluated with ECMA-334 7th edition semantics.
- Native AOT through generated dispatch. A source generator emits reflection-free dispatch from
[AlderRegistered]declarations. The interpreter runs under AOT without trim warnings. - Async inside expressions.
EvaluateAsyncawaits inside the bound tree.IAsyncEnumerable<T>,await foreach, and iterators are first-class through the interpreter. - One grammar, three surfaces. Expression evaluation, Dynamic LINQ (
WhereDynamic,OrderByDynamic), andExpression<TDelegate>export for EF Core all parse through the same binder, validate against the same security policy, and answer to the same execution limits.
Targets net8.0 and netstandard2.0. Zero third-party runtime dependencies.
Install
dotnet add package Alder
A first look
AlderEval is the static entry point. Calls run against a default engine and need no setup:
using Alder;
AlderEval.Evaluate<int>("1 + 2"); // 3
AlderEval.Evaluate<decimal>("price * 1.2m", new { price = 100m }); // 120m
AlderEngine exposes the same evaluation surface as an instance you own and configure. The choice between the two is about lifecycle and configuration, not capability:
using var engine = new AlderEngine();
var tier = engine.Evaluate<string>("""
var t = order switch
{
{ Total: > 1000m, IsRush: true } => "premium-express",
{ Total: > 1000m } => "premium",
{ IsRush: true } => "express",
_ => "standard"
};
return t;
""", new { order });
End-to-end integration
A configured AlderEngine carries compiler, security policy, and generated AOT dispatch into every call it serves:
using Alder;
using Alder.Compiled;
using var engine = new AlderEngine(options =>
{
options.UseCompiler();
options.Security = SecurityOptions.Trusted();
options.Aot.UseGeneratedContext(RulesAotContext.Default);
});
var accepted = engine.Evaluate<bool>(rule, new { order, minimum = 500m });
var quote = await engine.EvaluateAsync<decimal>(
"await pricing.QuoteAsync(order)",
new { order, pricing });
var report = await db.Orders
.WhereDynamic(engine, """Status == "Open" && Total >= @0""", 250m)
.OrderByDynamic<Order, decimal>(engine, "Total")
.SelectDynamic<Order, OrderSummary>(engine, "new { Id, Total }")
.ToListAsync();
Documentation
Full documentation, architecture notes, the language support matrix, security model, and Dynamic LINQ operator coverage live in the GitHub repository.
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Bcl.AsyncInterfaces (>= 8.0.0)
- System.Collections.Immutable (>= 8.0.0)
- System.Threading.Tasks.Extensions (>= 4.5.4)
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Breaking change: removed predefined Safe and Strict security policy presets. Alder now exposes Trusted as the only named preset and documents explicit SecurityOptions policies for host-owned security posture.