MOGWAI
MOGWAI – A modern RPN/stack-based scripting engine for .NET developers. Embed it in any app, script complex workflows, design your own DSL. Inspired by HP RPL.
Install / Use
/learn @Sydney680928/MOGWAIREADME
MOGWAI - A powerful stack-based RPN scripting engine for .NET
Embeddable, extensible, production-ready. From IoT automation to desktop scripting, one elegant RPN runtime for your .NET apps.
What is MOGWAI?
MOGWAI is a modern implementation of RPN (Reverse Polish Notation) for the .NET ecosystem. Inspired by the legendary HP calculators (HP 28S, HP 48), it brings the elegance and power of stack-based, concatenative programming to your applications — whether you're scripting complex workflows, embedding a runtime in a desktop or mobile app, designing a custom DSL, or automating IoT pipelines.
Key Features
- Stack-Based RPN Syntax - Clean, unambiguous, no operator precedence
- 240+ Built-in Functions - Math, strings, lists, files, HTTP, BLE, and more
- Async/Await Support - Modern asynchronous execution
- IoT Ready - Bluetooth Low Energy, serial ports, GPIO
- Battle-Tested - 10+ years of real-world usage
- Extensible - Easy integration with .NET applications
- Cross-Platform - Windows, Linux, macOS, Android, iOS
- Visual Debugging - MOGWAI STUDIO integration (coming soon)
The MOGWAI Ecosystem
MOGWAI Runtime (Open Source)
The core scripting engine, available as a NuGet package. Embed MOGWAI in your .NET applications.
- License: Apache 2.0
- Package: MOGWAI on NuGet
- Status: Production ready
MOGWAI CLI (Open Source)
Command-line interface for running MOGWAI scripts and interactive REPL sessions.
- License: Apache 2.0
- Repository: MOGWAI CLI
- Status: Functional
MOGWAI STUDIO (Coming Soon)
Visual IDE for MOGWAI development with debugging, breakpoints, and code editing.
- License: Proprietary (Freemium model)
- Status: In active development
- Features: Visual debugger, syntax highlighting, project management
- Release: TBA
Quick Start
Installation
Install the MOGWAI runtime via NuGet:
dotnet add package MOGWAI
Hello World
using MOGWAI.Engine;
using MOGWAI.Interfaces;
var engine = new MogwaiEngine("MyApp");
engine.Delegate = this; // Your class implementing IDelegate
var result = await engine.RunAsync(@"
\"Hello from MOGWAI!\" ?
2 3 + ?
", debugMode: false);

MOGWAI Language Example
# Variables
42 -> '$answer'
"Hello World" -> '$greeting'
# Functions
to 'square' with [n: .number] do
{
n n *
}
# Lists
(1 2 3 4 5) foreach 'n' transform { n square } -> '$result'
$result ? # Outputs the list of squares (1 4 9 16 25)
# Records
[name: "MOGWAI", version: "8.0"] -> 'info'
# Conditionals
if (answer 40 >) then
{
"Answer is greater than 40" ?
}
Build from Source
Prerequisites
- .NET SDK 9.0 or later
- Git
Clone and Build
# Clone repository
git clone https://github.com/Sydney680928/mogwai.git
cd mogwai
# Restore dependencies
dotnet restore src/MOGWAI/MOGWAI.sln
# Build
dotnet build src/MOGWAI/MOGWAI.sln --configuration Release
# Pack (optional)
dotnet pack src/MOGWAI/MOGWAI.sln --configuration Release
The compiled assembly will be in src/MOGWAI/MOGWAI/bin/Release/net9.0/.
Project Structure
mogwai/
├── src/
│ └── MOGWAI/
│ ├── MOGWAI.sln # Main solution
│ └── MOGWAI/
│ ├── Engine/ # Core runtime engine
│ ├── Objects/ # MOGWAI object types
│ ├── Primitives/ # Built-in functions (240+ primitives)
│ ├── Interfaces/ # Public interfaces (IDelegate, IPlugin)
│ └── Exceptions/ # Exception types
├── docs/
│ └── EN/
│ ├── MOGWAI_EN.md # Language reference
│ ├── MOGWAI_FUNCTIONS_EN.md # Function reference
│ └── MOGWAI_INTEGRATION_GUIDE_EN.md # Integration guide
├── images/ # Screenshots and media
├── LICENSE # Apache 2.0 license
├── NOTICE # Copyright notice
└── README.md # This file
Documentation
Complete Guides
- Language Reference - Complete MOGWAI language guide
- Function Reference - All 240+ built-in functions
- Integration Guide - How to integrate MOGWAI in your .NET apps
Examples
Examples are available :
- MOGWAI CLI - Command-line interface and REPL
- WinForms Example - Turtle graphics with MOGWAI
- MAUI Example - Cross-platform mobile app
- Blazor Example - Blazor WASM app
Changelog
See CHANGELOG.md for a detailed history of changes.
Latest Release: v8.4.0
MOGWAI STUDIO (Coming Soon)

MOGWAI STUDIO is a visual IDE for MOGWAI development currently in active development.
Planned Features
- Visual Debugger - Set breakpoints, step through code
- Syntax Highlighting - Color-coded MOGWAI syntax
- Variable Inspector - Examine variables in real-time
- Stack Visualization - See the stack state at any point
- Project Management - Organize scripts and modules
- Network Debugging - Debug remote MOGWAI runtimes
- Code Completion - IntelliSense for MOGWAI functions
Availability
Status: In development
Release Model: Freemium (Free version + Pro version)
Price: Pro version planned at €29 (one-time purchase)
Distribution: Gumroad + installer package
Stay tuned for updates on mogwai.eu.com!
Use Cases
Industrial IoT Automation
# Read sensor via BLE
"AA:BB:CC:DD:EE:FF" ble.connect -> 'device'
device "temperature" ble.read -> 'temp'
# Control based on value
if (temp 25 >) then
{
"fan" gpio.on
}

Use Case #1 — Electronic Board Test Bench
Embedded Applications
# WinForms turtle graphics
100 turtle.forward
90 turtle.right
100 turtle.forward
"Square complete!" ?

Blazor WASM Applications

You can test it live on Blazor REPL
Roadmap
Version 8.0 (Released)
- Complete rewrite with namespace organization
- 240+ primitives
- Apache 2.0 open source license
- Published on NuGet
- .NET 9.0 support
- Complete documentation
Version 8.4 (Latest)
- Plugin abstraction layer (
MOGWAI.Plugin.Abstractions) - AOT compatibility (
IsAotCompatible) - Major performance optimizations (O(1) primitive lookup, LINQ removal in hot paths)
bagprimitive!Aauto-eval sigil-->in-place pipeline operator- Binary data primitives (DATA/BIN families)
Version 8.5 (In Progress)
- MOGWAI STUDIO IDE (beta)
- Enhanced debugging protocol
- Additional examples and documentation
Future Plans
- MOGWAI STUDIO official release
- Community plugins marketplace
- Additional language integrations
- Extended function library
Contributing
Contributions are welcome! Here's how you can help:
Reporting Issues
Found a bug or have a feature request? Please open an issue on GitHub:
- Bug Reports: Use the bug report template
- Feature Requests: Describe the use case and expected behavior
- Questions: Use GitHub Discussions
Contributing Code
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Commit with clear messages (
git commit -m 'Add amazing feature') - Push to your fork (
git push origin feature/amazing-feature) - Open a Pull Request
Code Style
- Follow existing code conventions
- Add XML documentation comments for public APIs
- Keep functions focused and well-named
Testing
While we don't have formal unit tests, please ensure:
- Your changes compile without warnings
- Existing examples still work
- Add example scripts demonstrating new features
Why MOGWAI?
Born from Real Needs
Created in 2015 to simulate Bluetooth Low Energy devices for IoT testing. Over 10 years, MOGWAI evolved into a full-featured scripting language used in industrial automation.
Battle-Tested
- 10+ years of real-world usage - From prototyping to industrial environments
- Thousands of scripts - Executed in field deployments
HP Calculator Heritage
Inspired by the legendary HP 28S and HP 48 calculators, MOGWAI brings RPN elegance to modern software:
- Clear semantics - No operator precedence confusion
- Stack-based - Natural for complex calculations
- Composable - Build complex operations from simple parts
License
MOGWAI Runtime & CLI
Apache License 2.0
Copyright 2015-2026 Stéphane Sibué
Licensed under the Apache License, Version 2.0 (the "License");
you
