RuleScript.Core
1.10.1
dotnet add package RuleScript.Core --version 1.10.1
NuGet\Install-Package RuleScript.Core -Version 1.10.1
<PackageReference Include="RuleScript.Core" Version="1.10.1" />
<PackageVersion Include="RuleScript.Core" Version="1.10.1" />
<PackageReference Include="RuleScript.Core" />
paket add RuleScript.Core --version 1.10.1
#r "nuget: RuleScript.Core, 1.10.1"
#:package RuleScript.Core@1.10.1
#addin nuget:?package=RuleScript.Core&version=1.10.1
#tool nuget:?package=RuleScript.Core&version=1.10.1
RuleScript
RuleScript is a lightweight, embeddable .NET 8 scripting engine for rule-oriented workflows, automation, validation, JSON processing, and host-controlled execution.
It provides a lexer, parser, AST, interpreter, built-in functions, user functions, project imports, Host Function integration, HostTrigger runtimes, runtime diagnostics, and debugger APIs without exposing a full general-purpose programming language.
Installation
Install the stable package from NuGet:
dotnet add package RuleScript.Core --version 1.10.1
Quick Start
using RuleScript.Core.Runtime;
var engine = new RuleScriptEngine();
var context = new RuntimeContext();
context.Set("Name", "Mick");
context.Set("Distance", 519);
engine.Execute("""
var message = "Hello " + Name;
if Distance > 500 then:
result = message + ": NG";
else:
result = message + ": OK";
endif
""", context);
Console.WriteLine(context.Get<string>("result"));
Run a project file:
var engine = new RuleScriptEngine
{
WorkingDirectory = @"C:\rules"
};
var context = engine.ExecuteFile("main"); // Resolves main.rules
Register a Host Function:
engine.RegisterFunction("GetDistance", _ => 519);
var context = engine.Execute("result = GetDistance();");
Start a long-running HostTrigger runtime:
var engine = new RuleScriptEngine
{
ExecutionTimeoutEnabled = false
};
var runtime = engine.CreateRuntime("""
@HostTrigger("LotArrived")
function OnLotArrived(lotId: string) -> void:
Print("lot arrived: " + lotId);
return;
endfunction
parallel:
trigger task:
dispatch;
endtask
endparallel
""");
var running = runtime.StartAsync();
await runtime.TriggerAsync("LotArrived", ["LOT-001"]);
await runtime.StopAsync();
await running;
Documentation
Detailed syntax, Host integration, debugging, analysis, and version-specific behavior are maintained in the RuleScript Wiki.
- Getting Started
- Language Guide
- Built-in Function Reference
- Host Integration
- Debugging and Analysis
- API Reference by Class
- v1.10.1 release notes
- v1.10.1 API reference
- v1.10.0 release notes
- v1.9.0 release notes
- v1.8.0 maintenance notes
- v1.7.0 release notes
Development
The latest stable source is available on main. See the v1.10.1 release notes for source-file-aware analysis imports. See the v1.10.0 release notes for HostTrigger runtimes and long-running dispatch.
dotnet build RuleScript.sln
dotnet test RuleScript.sln
License
RuleScript is licensed under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
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.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.10.1 | 169 | 7/8/2026 |
| 1.10.0 | 114 | 7/7/2026 |
| 1.10.0-rc1.5 | 66 | 7/7/2026 |
| 1.10.0-rc1.4 | 63 | 7/7/2026 |
| 1.10.0-rc1.3 | 72 | 7/7/2026 |
| 1.10.0-rc1.2 | 61 | 7/7/2026 |
| 1.10.0-rc1.1 | 72 | 7/7/2026 |
| 1.10.0-rc1.0 | 79 | 7/7/2026 |
| 1.9.0 | 100 | 7/6/2026 |
| 1.9.0-rc1.1 | 65 | 7/6/2026 |
| 1.9.0-rc1.0 | 62 | 7/6/2026 |
| 1.8.0 | 103 | 7/6/2026 |
| 1.8.0-preview1.0 | 57 | 7/4/2026 |
| 1.7.0 | 103 | 7/3/2026 |
| 1.7.0-rc1.1 | 70 | 7/3/2026 |
| 1.7.0-rc1.0 | 66 | 7/3/2026 |
| 1.6.0 | 102 | 7/3/2026 |
| 1.6.0-rc1.4 | 59 | 7/3/2026 |
| 1.6.0-rc1.3 | 55 | 7/3/2026 |
| 1.6.0-rc1.2 | 70 | 7/3/2026 |