MOGWAI

MOGWAI

Open-source · .NET · Embeddable

Give your .NET app
a scripting engine
in 4 lines of code.

MOGWAI is an open-source, embeddable scripting engine for .NET — write it however feels natural: classic, C#-style calls, or drop down to native RPN when you want more control.

Think of it as VBA for your own application: make it programmable, add scripted automation, or build a full rule engine — without writing a parser.

Works on Windows, Linux, macOS, Android and iOS. Integrates into WinForms, WPF, MAUI, Blazor, ASP.NET — and more.

Under the hood, it's a stack-based engine inspired by HP48 RPL and FORTH — for when you want it.

v8.xOpen Source · Apache 2.03 years in productionNuGet package
350+
built-in primitives
10 yrs
in development
.NET 9
latest runtime
iOS · Android · Win
cross-platform via MAUI

Taste the stack

Classic-style calls or native RPN — your choice. No operator precedence. No ambiguity.

# Fibonacci — composed recursive logic reads cleanest in native RPN
to 'fib' with [n: .number] do {
if (n 2 <) then { n } else {
n 1 - fib   n 2 - fib   +
}
}

Then call it however feels natural — same result either way:

fib(10) ?  # → 55 (classic-style)
10 fib ?  # → 55 (native RPN)
// Integrate in 4 lines of C#
var engine = new MogwaiEngine("MyApp");
engine.Delegate = this;
await engine.RunAsync(@"10 fib ?");
// → 55

Use cases

Industrial automation
Script complex machine logic on-the-fly. No recompile, no redeploy. Battle-tested in production.
BLE & IoT devices
Born as a BLE emulator scripting language. Speaks HTTP natively today — BLE, serial and GPIO support is coming via the plugin system. Runs on Android and iOS via MAUI.
Embeddable rule engine
Like VBA for Excel, but for your own app. Make any WinForms, WPF, MAUI or Blazor application fully scriptable.
Test benches
Automate hardware test sequences with readable, debuggable scripts — tweak logic without touching the host app.
Deterministic, composable logic
Every operation reads left to right, no operator precedence to reason about — the stack is the single source of truth. (If you grew up on an HP 28S or HP 48, it'll feel instantly familiar.)
Plugin architecture
Expose your .NET methods as MOGWAI primitives. Your app's API becomes scriptable in minutes via a simple delegate interface.

What can you do with it?

By integrating MOGWAI, you can make any application fully "programmable", expanding its capabilities and enabling the creation of intelligent features on the fly (a very known exemple is Excel or Word with VBA).

The Birth of MOGWAI

From a HP 48 to .NET
It started with a love for HP RPL — the elegant stack-based language of HP scientific calculators. The idea: bring that same power and elegance to modern .NET development.
A real-world problem
We needed to simulate a BLE device before the hardware even existed. No tool did the job. So we built a scripting engine ourselves — and MOGWAI was born.
10 years later
What started as an internal tool is now an open-source engine with 350+ primitives, running in production — powering the full test suite of an industrial electronic board test bench.

Cross-Platform Support

With .NET MAUI, MOGWAI can be used on iOS, Android, and Windows without any modifications. Integration is immediate.

How to integrate MOGWAI ?

Just 4 easy steps:
1. Reference mogwai in your project (NuGet package).
2. Create a runtime instance.
3. Assign a delegate.
4. Implement the delegate’s functions.
That’s it! Once set up, the runtime is ready to execute any code you provide.You can use VS Code extension for MOGWAI. Connect, develop, and manage your projects effortlessly with VS Code.

YouTube

MOGWAI has its own YouTube channel, providing tutorials and resources to master the language and integrate it seamlessly.

GitHub

All the resources you need to use and integrate
MOGWAI into your applications
are available on GitHub.

© MOGWAI. All rights reserved.