Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.14.4 instead.
Reason given by maintainers: Stale build: this wheel's Verilog backend does not match the 0.14.0 source tree and cannot lower ekf2d_filter designs. Use 0.14.3 or later.

Monogate Forge

CI PyPI VS Code Marketplace License: MIT Python

Forge is the EML language and compiler. Write a math kernel once, compile it to 17 production backends — 12 software targets emit locally from the CLI, 5 hardware/manufacturing/proof targets emit through the hosted service — with chain-order analysis and Lean-checkable contracts on every function. The full catalog runs to 36 across software, GPU shaders, FPGA RTL, manufacturing artifacts, formal-verification proofs, and safety-critical avionics; the tables below show which are live today.


Quick start

pip install monogate-forge

Create hello.eml:

module hello;

fn pid(error: Real, integral: Real, derivative: Real) -> Real
    where chain_order <= 0
    requires (-1.0 <= error && error <= 1.0)
    ensures  (-1.5 * 1.0 <= result && result <= 1.5 * 1.0)
{
    let kp = 1.0;
    let ki = 0.2;
    let kd = 0.3;
    kp * error + ki * integral + kd * derivative
}

Compile to every target at once:

eml-compile hello.eml --target all -o build/

You now have build/hello.c, build/hello.rs, build/hello.py, build/hello.lean, build/hello.v, build/hello.hlsl, build/hello.metal, build/hello.swift, … one file per target. Pick a single target instead:

eml-compile hello.eml --target rust -o hello.rs
eml-compile hello.eml --target c    -o hello.c
eml-compile hello.eml --target lean -o Hello.lean

A snippet of hello.rs:

use monogate_sys::*;

/// pid
/// Chain order: 0     Cost class: p0-d2-w0-c0
/// EML depth:   2  Drift risk: LOW
/// Dynamics:    0 osc, 0 decay  (predicted_r=0)
/// FPGA est:   2 MAC, 0 exp, 0 ln, 0 trig -> 4 cy @ 32-bit
pub fn pid(error: f64, integral: f64, derivative: f64) -> f64 {
    assert!((((-1.0) <= error) && (error <= 1.0)), "pid: requires ((((-1.0) <= error) && (error <= 1.0)))");
    let kp: f64 = 1.0;
    let ki: f64 = 0.2;
    let kd: f64 = 0.3;
    (((kp * error) + (ki * integral)) + (kd * derivative))
}

Every emitted function carries its EML profile (chain order, cost class, drift risk, FPGA cycle estimate) in the doc-comment header so a reviewer can see the analysis without leaving the file. The requires contract from the EML source becomes a runtime assert! with the offending expression in the panic message.

Five-minute tour: docs/quickstart.md. Full tutorial: monogate.dev/learn/eml/intro.


What you get

12 local. 5 hosted. The catalog runs to 36 — and we list it openly. Twelve software backends — C, C++, Rust, Python, Go, Java, Kotlin, C#, JavaScript, MATLAB, WebAssembly, Lean 4 — emit production code from the CLI on your machine, Free tier, no account needed. Five additional Pro-tier backends — hardware, manufacturing, and formal-proof targets that need heavy toolchains best run server-side — are live today on the hosted compile service at monogateforge.com. The remaining 19 targets in the tables below are scaffolded: the EML frontend parses them and the IR understands their lowering shape, but the production emitter is still under construction. We list the full catalog so you can pick a target knowing exactly what runs today — every entry below is tagged with its tier, and the per-target docs at docs/backends.md call out scaffold-vs-production status.

Software (general-purpose)

Target Flag Tier
C99 --target c Free
C++17 --target cpp Free
Rust --target rust Free
Python 3 --target python Free
Go --target go Free
Java --target java Free
Kotlin --target kotlin Free
C# --target csharp Free
JavaScript --target javascript Free
MATLAB --target matlab Free
Swift --target swift Pro

Compiler IRs

Target Flag Tier
WebAssembly --target wasm Free
LLVM IR --target llvm Pro

GPU shaders

Target Flag Tier
HLSL (DirectX) --target hlsl Pro
GLSL (desktop) --target glsl Pro
GLSL ES --target glsles Pro
WGSL (WebGPU) --target wgsl Pro
Metal (Apple) --target metal Pro

Hardware (FPGA / ASIC)

Target Flag Tier
Verilog --target verilog Pro
SystemVerilog --target systemverilog Pro
VHDL --target vhdl Pro
Chisel / FIRRTL --target chisel Pro

Manufacturing / circuits

Target Flag Tier
spice --target spice Pro
kicad --target kicad Pro
jlcpcb --target jlcpcb Pro

Formal verification

Target Flag Tier
Lean 4 --target lean Free
Coq --target coq Pro
Isabelle/HOL --target isabelle Pro

Safety-critical

Target Flag Tier
Ada/SPARK --target ada Pro
AUTOSAR C --target autosar Pro
AADL --target aadl Pro
ROS 2 / C++ --target ros2 Pro

Gaming

Target Flag Tier
Luau (Roblox) --target luau Pro
GDScript (Godot) --target gdscript Pro

Blockchain

Target Flag Tier
Solidity (PRBMath SD59x18) --target solidity Pro

Zero-knowledge

Target Flag Tier
Plonky2 ZK circuits (research) --target zkproof Free

The Free tier (the 12 production-ready software targets above plus the research-tier zkproof backend) is enough to take any EML kernel from your laptop to the browser to a Lean 4 proof without a license or an account. A Pro license unlocks the 5 production backends live on the hosted service today — hardware, manufacturing, and formal-proof targets that need heavy toolchains best run server-side — and reserves your slot in the catalogued Pro targets that follow as their production emitters ship. The scaffolded backends keep the same EML source unchanged, so anything you write now compiles forward without a rewrite. The specific subset of Pro backends production-ready at any given time — and what each scaffolded target is waiting on — is tracked at docs/backends.md. Get a license at monogateforge.com/get-started.


VS Code extension

Install

ext install monogate.eml-lang

LSP features:

  • Chain-order on hover — every function shows its profiled chain order, cost class, and node count.
  • Completions — keywords (fn, let, where, requires, ensures, module, use), builtins (exp, ln, sin, cos, sqrt, tanh, pow, clamp, eml, …), stdlib modules.
  • Diagnostics — type errors, unbound identifiers, chain-order violations, contract failures.
  • FPGA status bar — for any function annotated @target(fpga), the status bar shows estimated LUT / DSP / latency for the selected device.
  • Format on save — canonical layout via eml-fmt.

Marketplace listing: monogate.eml-lang.


Why Forge

Industrial automation today is stuck on ladder logic — Boolean rungs from the 1960s that can't express transcendental functions, can't prove correctness, can't optimize node count, and treat PID loops as black boxes. Structured Text is marginally better but still opaque. MATLAB/Simulink + HDL Coder will get you to FPGA, but the math hides inside vendor library calls and you have no formal proof of precision.

EML makes every mathematical operation visible, measurable, optimizable, and formally verifiable. Every expression is an EML tree, every function carries a chain order, every contract becomes a Lean theorem. The same source compiles to your laptop, your microcontroller, your FPGA, your Solidity contract, and your formal proof — and the cross-target equivalence harness verifies they agree to the bit.


Documentation

  • Quickstart — pip install to first compile in 5 minutes.
  • Language reference — every keyword, builtin, type, and annotation.
  • Backends — every compilation target with its CLI flag, file extension, and tier.
  • Verify guide@verify, requires/ensures, Lean output, MachLib integration.
  • FPGA guide@target(fpga), LUT/DSP estimates, precision selection, vendor support.

External:


Contributing

See CONTRIBUTING.md. Bug reports and feature requests via GitHub issues.

License

Compiler is MIT (see LICENSE). Specific algorithmic methods covered by patents — open implementation, but commercial re-implementations may need a license. See patents/index.md.

Built by Mosa Creates LLC.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

monogate_forge-0.14.0.tar.gz (661.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

monogate_forge-0.14.0-py3-none-any.whl (773.6 kB view details)

Uploaded Python 3

File details

Details for the file monogate_forge-0.14.0.tar.gz.

File metadata

  • Download URL: monogate_forge-0.14.0.tar.gz
  • Upload date:
  • Size: 661.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for monogate_forge-0.14.0.tar.gz
Algorithm Hash digest
SHA256 d198ecdb2bfb13ee9de67c6661d1f34a1ca07badc565365e590041d2ede9811d
MD5 22da8ee4deed12768db8e87eb49d65c2
BLAKE2b-256 99ea27bf01aab4cf2a138e232fe122dd16bf1f116b6c84278e08414157b5e627

See more details on using hashes here.

File details

Details for the file monogate_forge-0.14.0-py3-none-any.whl.

File metadata

File hashes

Hashes for monogate_forge-0.14.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8ebe4d74d1115c579be3b68f7f41ac2089704731874ff279526dd8888ec62f7f
MD5 f50048bbab210c2bd9344bd000660230
BLAKE2b-256 cabe9dc932dc8cd0c3f320d8db0aba4e5f6a3f12baa660c1500f2c57f9e8ae55

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page