Mages 4.0.0-alpha-76
See the version list below for details.
dotnet add package Mages --version 4.0.0-alpha-76
NuGet\Install-Package Mages -Version 4.0.0-alpha-76
paket add Mages --version 4.0.0-alpha-76
#r "nuget: Mages, 4.0.0-alpha-76"
#:package Mages@4.0.0-alpha-76
#addin nuget:?package=Mages&version=4.0.0-alpha-76&prerelease
#tool nuget:?package=Mages&version=4.0.0-alpha-76&prerelease
MAGES
MAGES (Mages: Another Generalized Expression Simplifier) is a lightweight, ultra-fast expression parser, compiler, and interpreter for .NET. It lets you embed a sandboxed scripting engine into your application without any external runtime dependencies.
This package contains the MAGES library (Mages.Core). If you are looking for the command-line tool and REPL, install Mages.Compiler instead.
Installation
dotnet add package Mages
The library targets .NET Standard 2.1 and therefore runs on .NET Core 3.0+, .NET 5+, Mono 6.4+, and Unity 2021.2+.
Usage
Create an engine to hold a global scope and start interpreting:
using Mages.Core;
var engine = new Engine();
var result = engine.Interpret("sin(2) * cos(pi / 4)"); // 0.642970376623918
Compile once, run many times:
var expOne = engine.Compile("exp(1)");
var result = expOne(); // 2.71828182845905
Expose your own data and functions to scripts:
engine.Scope["x"] = 4.0;
engine.SetFunction("sq", (Double v) => v * v);
var result = engine.Interpret("sq(x) + 1"); // 17.0
Get functions defined in MAGES back into C#:
var func = engine.Interpret("(x, y) => x * y + 3 * sqrt(x)") as Function;
var result = func.Call(4, 3); // 18.0
Features
- Numbers, complex numbers, strings, booleans, matrices, objects, and first-class functions
- Interpolated strings, JSX syntax, pattern matching, pipes, and placeholders for currying
- No IL emitted at runtime, so it also works on platforms with AOT restrictions
- Full control over the exposed API, which makes sandboxing user scripts straightforward
- Editor tooling support such as auto-completion (
GetCompletionAt) and AST validation
Documentation
License
MIT - see the license file for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Mages:
| Package | Downloads |
|---|---|
|
LisaCore
CSharp dynamic runtime code execution |
|
|
OmicronLab.VectorNetworkAnalysis.MidLayer
This package contains all the Mid-Layer components needed to measure with a VNA device. |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Mages:
| Repository | Stars |
|---|---|
|
Flow-Launcher/Flow.Launcher
:mag: Quick file search & app launcher for Windows with community-made plugins
|
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.0-alpha-80 | 92 | 9/15/2026 |
| 4.0.0-alpha-79 | 92 | 9/14/2026 |
| 4.0.0-alpha-78 | 86 | 9/14/2026 |
| 4.0.0-alpha-77 | 92 | 9/14/2026 |
| 4.0.0-alpha-76 | 93 | 9/14/2026 |
| 4.0.0-alpha-75 | 89 | 9/14/2026 |
| 4.0.0-alpha-74 | 93 | 9/14/2026 |
| 4.0.0-alpha-69 | 96 | 9/13/2026 |
| 3.0.1 | 18,735 | 11/13/2025 |
| 3.0.1-alpha-67 | 321 | 11/13/2025 |
| 3.0.0 | 16,743 | 12/24/2024 |
| 3.0.0-alpha-61 | 219 | 12/24/2024 |
| 3.0.0-alpha-59 | 212 | 12/24/2024 |
| 3.0.0-alpha-57 | 200 | 12/24/2024 |
| 3.0.0-alpha-55 | 215 | 12/24/2024 |
| 3.0.0-alpha-53 | 217 | 12/21/2024 |
| 3.0.0-alpha-52 | 204 | 12/21/2024 |
| 3.0.0-alpha-51 | 231 | 12/21/2024 |
| 3.0.0-alpha-50 | 221 | 12/21/2024 |
| 3.0.0-alpha-49 | 238 | 9/5/2024 |
For all changes see: https://github.com/FlorianRappl/Mages/blob/main/CHANGELOG.md.