-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
Liu.Yandong.Hanks edited this page Aug 21, 2026
·
3 revisions
Install AuroraScript.JIT, compile your first module, and execute it from a .NET host.
Applies to 4.0.0.
Home · Host Integration · Language Guide
On this page
Install the NuGet package in the .NET host project:
dotnet add package AuroraScript.JIT --version 4.0.0The package targets net8.0, net9.0, and net10.0. Dynamic and OnlyRun work on all three targets; Persistence requires net9.0 or later.
First create scripts/main.as. @module must be the first effective statement.
@module(MAIN);
export func main(value) {
return value + 22;
}
Then create the engine, build the script, create a domain, and execute the exported function.
using AuroraScript;
using AuroraScript.Core;
using AuroraScript.Runtime;
var options = EngineOptions.Default
.WithCompiler(compiler =>
{
compiler.SourceResolver = ScriptSources.FileSystem("./scripts");
compiler.Mode = CompilationMode.Dynamic;
});
var engine = new AuroraEngine(options);
await engine.BuildAsync("main.as");
using var domain = engine.CreateDomain();
var result = domain.Execute("MAIN", "main", ScriptDatum.FromNumber(20));
Console.WriteLine(result); // 42AuroraEngine owns configuration and compilation; ScriptDomain is an isolated execution environment with its own global object and module instances.
- Learn modules, functions, closures, and syntax: Language Guide.
- Inject globals, state, or CLR types: Host Integration.
- Look up objects, methods, and parameters: Script API Reference.
- Choose compilation modes and optimize hot paths: Performance and Benchmarks.
- Use MCP, LSP, or the VSIX: Tooling.
AuroraScript.JIT 4.0.0 · Documentation Home · Repository · MIT License