MetaForge

A modular, multi-language file compiler and runner for .mfg files. Parse, compile, and execute with JavaScript, Python, or C++.

Features

📄

Parse .mfg Files

Easily parse structured .mfg files into groups, blocks, and argument blocks with simple syntax.

🔧

Variable Expansion

Support for dynamic variables and argument blocks that can be referenced throughout your files.

Multi-Language Support

Native implementations in JavaScript, Python, C++, Rust for maximum flexibility and performance.

🚀

Execute Blocks

Run specific blocks or groups directly from the CLI with simple commands.

📦

Modular Design

Clean, modular architecture that's easy to extend and integrate into your workflow.

🎯

CLI Friendly

Powerful command-line interface for automation and scripting tasks.

Documentation

.mfg File Syntax

MetaForge files use a simple, structured syntax to define groups, blocks, and arguments:

MFG Syntax
# Define a group
group mygroup {
    # Define a block
    block myblock {
        run echo "Hello, World!"
    }
    
    # Block with arguments
    block greet {
        args {
            name = "User"
        }
        run echo "Hello, ${name}!"
    }
}

CLI Usage

Run MetaForge from the command line with any of the three implementations:

JavaScript
# Run the entire file
node compiler.js file.mfg

# Run a specific block
node compiler.js file.mfg --block mygroup.myblock

# Pass arguments
node compiler.js file.mfg --block mygroup.greet --args name=Alice
Python
# Run the entire file
python compiler.py file.mfg

# Run a specific block
python compiler.py file.mfg --block mygroup.myblock
C++
# Compile and run
g++ -o metaforge compiler.cpp
./metaforge file.mfg

# Run a specific block
./metaforge file.mfg --block mygroup.myblock

Downloads

Choose your preferred language implementation

JavaScript

Node.js 14+

Download JS

Python

Python 3.7+

Download Python

C++

C++17+

Download C++

Live Demo

Try parsing a .mfg file in your browser (JavaScript implementation)

Output:

Click "Parse & Run" to see the output...

Get Involved

MetaForge is open source and welcomes contributions from the community.