Metamorf is a Turing complete programming language for building compilers. You describe a complete programming language in a .mor file, covering tokens, types, grammar rules, semantic analysis, and C++23 code generation. Metamorf reads that file and immediately uses it to compile source files to native Win64/Linux64 binaries via Zig/Clang.
Metamorf -l pascal.mor -s hello.pas -rOne file defines your language. One command compiles and runs your program.
Most language definition tools (YACC, ANTLR, traditional BNF grammars) give you a declarative grammar and then punt to a host language for anything non-trivial. Metamorf is different. It is a complete, Turing complete language with variables, assignment, unbounded loops, conditionals, arithmetic, string operations, and user-defined routines with recursion, all first-class constructs alongside declarative grammar rules and token definitions.
No host language glue code. No build system integration. No escape hatch to C, Java, or Python. A single .mor file is a complete, portable, standalone language specification that produces native binaries.
What you get:
- Single-file language definitions covering the entire pipeline: lexer tokens, Pratt parser grammar, semantic analysis, and C++23 code generation
- Turing complete language with variables, loops, conditionals, recursion, and string operations as first-class constructs
- Pratt parser grammar rules with declarative prefix/infix/statement patterns and full imperative constructs for complex parsing
- IR builder code generation producing structured C++23 through typed builders
- Automatic C++ passthrough so your language can interoperate with C/C++ without any
.morconfiguration - Modular imports for splitting large language definitions across multiple
.morfiles - Native binary output for Win64 and Linux64 via Zig/Clang, with cross-compilation through WSL2
Metamorf reads your .mor file, populates its internal dispatch tables (token definitions, grammar rules, semantic handlers, emitter handlers), then uses those tables to lex, parse, analyze, and generate C++23 from your source file. The generated C++ is compiled to a native binary via Zig/Clang.
┌─────────────┐ ┌──────────────┐ ┌──────────────────┐
│ mylang.mor │────►│ .mor parser │────►│ dispatch tables │
└─────────────┘ └──────────────┘ └────────┬─────────┘
│
┌─────────────────┐ │
│ myprogram.src │───┐ │
└─────────────────┘ │ │
▼ ▼
┌─────────────────────────────────────┐
│ lex ──► parse ──► analyze ──► C++23 │
└──────────────────┬──────────────────┘
│
┌─────┴─────┐
│ Zig/Clang │
└─────┬─────┘
│
┌───────┴───────┐
│ native binary │
└───────────────┘
See the Metamorf Manual for the complete guide: architecture, grammar rules, semantic analysis, code emission, type inference, worked examples, and a checklist for building a new language.
Metamorf ships as a self-contained release with everything included. No separate toolchain download, no configuration.
- Download the latest release from GitHub Releases
- Extract the archive to any directory
- Write a
.morlanguage definition and a source file, then compile:
Metamorf -l mylang.mor -s hello.srcTo build and run in one step:
Metamorf -l mylang.mor -s hello.src -rTo target Linux from Windows, install WSL2 with Ubuntu:
wsl --install -d Ubuntugit clone https://github.com/tinyBigGAMES/Metamorf.gitMetamorf/repo/
src/ <- Metamorf core sources
tests/ <- Test files including pascal.mor, lua.mor, scheme.mor
docs/ <- Reference documentation
bin/ <- Executables run from here
| Requirement | |
|---|---|
| Host OS | Windows 10/11 x64 |
| Linux target | WSL2 + Ubuntu (wsl --install -d Ubuntu) |
| Building from source | Delphi 12 or higher |
Each release includes the full source alongside the binaries. No separate download required.
- Download the latest release from GitHub Releases and extract it
- Open
src\Metamorf - Language Engineering Platform.groupprojin Delphi 12 or higher - Build the project
Important
This repository is under active development. Language surfaces may change without notice. Each release aims to be stable and usable as we work toward v1.0. Follow the repo or join the Discord to track progress.
Metamorf is an open project. Whether you are fixing a bug, improving documentation, adding a new showcase language, or proposing a feature, contributions are welcome.
- Report bugs: Open an issue with a minimal reproduction. The smaller the example, the faster the fix.
- Suggest features: Describe the use case first. Features that emerge from real problems get traction fastest.
- Submit pull requests: Bug fixes, documentation improvements, new language examples, and well-scoped features are all welcome. Keep changes focused.
Join the Discord to discuss development, ask questions, and share what you are building.
Metamorf is built in the open. If it saves you time or sparks something useful:
- ⭐ Star the repo: it costs nothing and helps others find the project
- 🗣️ Spread the word: write a post, mention it in a community you are part of
- 💬 Join us on Discord: share what you are building and help shape what comes next
- 💖 Become a sponsor: sponsorship directly funds development and documentation
- 🦋 Follow on Bluesky: stay in the loop on releases and development
Metamorf is licensed under the Apache License 2.0. See LICENSE for details.
Apache 2.0 is a permissive open source license that lets you use, modify, and distribute Metamorf freely in both open source and commercial projects. You are not required to release your own source code. The license includes an explicit patent grant. Attribution is required; keep the copyright notice and license file in place.
Metamorf™ - Define It. Compile It. Ship It.
Copyright © 2025-present tinyBigGAMES™ LLC
All Rights Reserved.
