UniversalToolchain.Wist
0.1.0-preview.2
dotnet add package UniversalToolchain.Wist --version 0.1.0-preview.2
NuGet\Install-Package UniversalToolchain.Wist -Version 0.1.0-preview.2
<PackageReference Include="UniversalToolchain.Wist" Version="0.1.0-preview.2" />
<PackageVersion Include="UniversalToolchain.Wist" Version="0.1.0-preview.2" />
<PackageReference Include="UniversalToolchain.Wist" />
paket add UniversalToolchain.Wist --version 0.1.0-preview.2
#r "nuget: UniversalToolchain.Wist, 0.1.0-preview.2"
#:package UniversalToolchain.Wist@0.1.0-preview.2
#addin nuget:?package=UniversalToolchain.Wist&version=0.1.0-preview.2&prerelease
#tool nuget:?package=UniversalToolchain.Wist&version=0.1.0-preview.2&prerelease
UniversalToolchain.Wist
Tiny controlled rules for .NET applications.
UniversalToolchain.Wist is the first-contact package for UniversalToolchain. It gives .NET applications a small facade for restricted formula execution without exposing the lower-level compiler pipeline, dialect host, manifests, DynamicMethod, AIR, or session APIs.
Use it when configuration starts turning into logic:
admin / config / LLM suggestion
-> tiny rule text
-> restricted formula surface
-> validation or rejection
-> typed compiled delegate for hot paths
-> your application decides the side effect
Install
The package metadata in this repository is prepared for UniversalToolchain.Wist 0.1.0-preview.2.
dotnet add package UniversalToolchain.Wist --version 0.1.0-preview.2
Requirements:
- target framework:
net10.0; - .NET SDK
10.0.103or a compatible prerelease SDK accepted by the repositoryglobal.json.
30-second example
using UniversalToolchain.Wist;
using var rules = WistEngine.CreateSafeFormulas();
var rolloutScore = rules.Compile<Func<double, double, double, double>>(
"usage * 0.7 + reliability * 0.3 - incidents * 15.0",
"usage",
"reliability",
"incidents");
double score = rolloutScore.CompiledDelegate(100.0, 90.0, 1.0);
bool enableNewDashboard = score >= 80.0;
The formula returns data. The host application performs the action.
Validation without throwing
Use Validate before storing or executing user/admin/config-supplied formulas:
using UniversalToolchain.Wist;
using var rules = WistEngine.CreateSafeFormulas();
var validation = rules.Validate(
"let score = usage * 0.7\nscore",
new
{
usage = 100.0,
reliability = 90.0,
incidents = 1.0
});
if (!validation.IsValid)
{
Console.WriteLine(validation.Message);
}
The current safe-formula preset starts narrow. Statement-style bindings such as let are rejected by that restricted surface.
Hot path vs convenience path
Use Evaluate<T> for one-off previews, admin tools, tests, and non-hot paths:
double score = rules.Evaluate<double>(
"usage * 0.7 + reliability * 0.3",
new
{
usage = 100.0,
reliability = 90.0
});
Use Compile<TDelegate> when the same formula is invoked repeatedly:
var formula = rules.Compile<Func<double, double, double>>(
"usage * weight",
"usage",
"weight");
for (var i = 0; i < usages.Length; i++)
{
results[i] = formula.CompiledDelegate(usages[i], weights[i]);
}
Rule of thumb:
Use Evaluate for one-off execution.
Use Compile<TDelegate> for hot paths.
Compilation is expensive.
Invocation is the performance-oriented path.
Presets
WistEngine.CreateRestrictedArithmetic();
WistEngine.CreateFullNativePreview();
// Compatibility aliases:
WistEngine.CreateSafeFormulas();
WistEngine.CreateBusinessRules();
WistEngine.CreateTrusted();
CreateRestrictedArithmetic is the recommended first-contact preset for restricted formulas. CreateSafeFormulas remains a compatibility alias for it.
CreateFullNativePreview, CreateBusinessRules, and CreateTrusted are broad trusted-preview entry points in this preview. Do not use them for arbitrary untrusted input.
Security and trust
Restricted presets limit the selected language/runtime surface. They are not hardened sandboxes for arbitrary untrusted code. Compiled execution is a performance feature, not a sandbox boundary. Treat untrusted script execution as high risk and isolate it at the process/environment level when needed.
Current preview scope
This facade currently exposes:
- convenience
Evaluate<T>; - non-throwing
Validate; - typed fast
Compile<TDelegate>andTryCompile<TDelegate>; CompileFunccompatibility overloads for one, two, and three arguments;- backend-neutral compiled program metadata.
The larger direction is controlled application DSLs for .NET. The current stable preview claim is restricted numeric/formula execution, validation, and typed compiled invocation for supported shapes.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- GrEmit (>= 3.5.1)
- Microsoft.Extensions.DependencyInjection (>= 10.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-preview.2 | 87 | 7/6/2026 |
| 0.1.0-preview.1 | 68 | 5/10/2026 |
| 0.1.0-alpha.7 | 68 | 8/13/2026 |
| 0.1.0-alpha.1 | 580 | 7/14/2026 |
See CHANGELOG.md for release notes.