Skip to content

Getting Started

Liu.Yandong.Hanks edited this page Aug 21, 2026 · 3 revisions

Getting Started

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

Installation

Install the NuGet package in the .NET host project:

dotnet add package AuroraScript.JIT --version 4.0.0

The package targets net8.0, net9.0, and net10.0. Dynamic and OnlyRun work on all three targets; Persistence requires net9.0 or later.

Your First Module

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); // 42

AuroraEngine owns configuration and compilation; ScriptDomain is an isolated execution environment with its own global object and module instances.

Next steps

Clone this wiki locally