MOGWAI

MOGWAI

Open-source · .NET · Stack-based

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

MOGWAI is an open-source, stack-based scripting engine for .NET — inspired by HP48 RPL and FORTH.

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.

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

Taste the stack

RPN with syntactic sugar. No operator precedence. No ambiguity.

# Fibonacci — clean and readable
to 'fib' with [n: .number] do {
if (n 2 <) then { n } else {
n 1 - fib   n 2 - fib   +
}
}
10 fib ?  # → 55
// 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. Supports serial, GPIO, HTTP and more. 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.
HP calculator nostalgia
Loved the HP 28S or HP 48? MOGWAI brings RPL-style stack programming to the modern .NET world. Your muscle memory still works.
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 240+ 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 also use MOGWAI STUDIO — your dedicated IDE for the MOGWAI runtime. Connect, develop, and manage your projects effortlessly.

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.