Lightweight. Ultra-Fast.
Mathematical Scripting.
MAGES is a powerful expression parser, compiler, and interpreter for .NET applications. Native support for complex numbers, matrices, JSX syntax, and first-class functions with zero external runtime dependencies.
# Install MAGES library
$ dotnet add package Mages
# Install global CLI compiler & REPL
$ dotnet tool install --global Mages.Compiler
# Launch the interactive REPL
$ magesBuilt for Modern .NET Applications
Designed from the ground up for maximum throughput, low memory footprint, and seamless .NET integration.
Ultra High Performance
Linear operation chain VM eliminates GC pressure. Compile expressions once and execute them with maximum throughput in your critical loops.
Matrices & Complex Numbers
First-class mathematical primitives including multi-dimensional matrices, linear algebra solvers, complex numbers, and trigonometric functions.
JSX Syntax & Objects
Write declarative tree structures directly in code using JSX syntax. Inspect object metadata dynamically using the built-in type and json operators.
Global CLI Tool
The Mages.Compiler package brings a full-featured command-line interpreter, interactive REPL, and script runner to any modern terminal.
VS Code LSP Extension
Language Server Protocol (LSP) extension with real-time diagnostics, syntax highlighting, IntelliSense completions, hover docs, and signature tooltips.
Extensible & Sandbox-Ready
Easily expose custom C# classes, methods, and delegates. Full control over accessible APIs and scopes for sandboxed user scripting.
Clean, Expressive Syntax
Look at how intuitive mathematical scripting feels in MAGES.
C# Host Integration
using Mages.Core;
var engine = new Engine();
// Expose variables & functions
engine.Scope["x"] = 4.0;
engine.SetFunction("sq", (double v) => v * v);
// Evaluate or compile
var result = engine.Interpret("sq(x) + sin(pi / 2)");
Console.WriteLine(result); // 17.0MAGES Language Features
// Functions, pipes, and currying
var add = (a, b) => a + b;
var calc = 5 | add(10, _); // 15
// Matrix arithmetic & operations
var A = [1, 2; 3, 4];
var invA = inv(A);
var I = A * invA;
// JSX templating
var view = <div class="card"><h1>MAGES</h1></div> | html;Ready to add scripting to your application?
Check out our step-by-step tutorial and API documentation.
