Skip to content
bizzehdee edited this page Jun 24, 2026 · 4 revisions

DScript Wiki

DScript is an open-source, object-oriented, JavaScript-like scripting language implemented in C#. It compiles source to bytecode and executes on a stack-based virtual machine.

Contents

Page Description
Engine Core engine API — creating, configuring, and running scripts
Language Full language reference — syntax, types, operators, control flow
Standard-Library DScript.Extras module reference (console, Math, fs, http, …)
REPL Interactive read-eval-print loop
Resource-Limits Timeouts, instruction limits, and ScriptTimeoutException
Permissions Sandboxing with EnginePermissions
Host-Objects Exposing C# objects to scripts with SetGlobal
Modules require, import, module, exports, __filename, __dirname
Debugger Step debugger and breakpoint API
Profiler CPU profiling with V8-compatible .cpuprofile output
Bytecode Compiling, serialising, and reloading bytecode
JIT Optional JIT compilation of hot chunks; Reflection.Emit and no-reflection back-ends

Quick start

using DScript;
using DScript.Extras;

var engine = new ScriptEngine();
new EngineFunctionLoader().RegisterFunctions(engine);

engine.Execute("var result = 6 * 7;");
Console.WriteLine(engine.Root.GetParameter("result").Int); // 42
dotnet add package DScript
dotnet add package DScript.Extras

Clone this wiki locally