Skip to content

Repository files navigation

Metor Programming Language (.mtr)

Metor is a fully autonomous, high-performance programming language and AI tensor engine built completely from scratch using Rust and LLVM. It features its own native toolchain (Forge), a built-in package manager (Metos), high-concurrency socket networking, and a custom VS Code extension identity.


🌟 Key Features

  • Dedicated File Extension (.mtr): Clean, custom syntax extension completely independent from other ecosystems.
  • LLVM-Backed Compiler: Engineered in Rust, utilizing a custom lexer, parser, type checker, and LLVM IR code generator to output native machine code (.o).
  • Metos Package Manager: Full project bootstrapping (forge new), dependency configuration (metos.toml), and automatic module linking from metos_modules/.
  • High-Performance Runtime & AI Engine:
    • Native HTTP Server (serve): Multi-threaded TCP/HTTP server loop built directly into the core runtime.
    • Matrix Multiplication (matmul): Low-level hardware-accelerated tensor operations for AI and machine learning workloads.
    • Zero-Dependency JSON Parser (json_get): Fast payload extraction for web APIs.
  • Custom VS Code Integration: First-class syntax highlighting and a custom branded icon theme (.mtr file badges).

📂 Project Structure

Metor/
├── editors/
│   └── vscode-metor/       # VS Code extension, syntax grammar, and icon themes
├── src/
│   ├── cli/                # Forge command-line interface and arguments parser
│   ├── compiler/           # Lexer, Parser, Type Checker, Codegen, and Linker
│   └── main.rs             # Compiler entry point
├── Cargo.toml              # Rust compiler workspace manifest
└── README.md


Getting Started
Prerequisites
Rust & Cargo (latest stable edition)

LLVM / Inkwell dependencies

C Compiler (cc / clang / gcc) for native linking

1. Build the Forge Toolchain
Clone the repository and compile the compiler using Cargo:

Bash
git clone [https://github.com/adi6206096675/Metor.git](https://github.com/adi6206096675/Metor.git)
cd Metor
cargo build --release
2. Create a New Metor Project
Initialize a new project using the Forge CLI:

Bash
cargo run -- new my_backend
cd my_backend
This generates a structured workspace containing:

metos.toml — Package configuration and dependency declarations.

src/main.mtr — Main source entry point.

3. Install Dependencies
Resolve and fetch package modules into metos_modules/:

Bash
cargo run --manifest-path ../Cargo.toml -- install
4. Build or Run Your Program
Compile your .mtr source file into a standalone native executable:

Bash
cargo run --manifest-path ../Cargo.toml -- run src/main.mtr
📝 Example Metor Code
Code snippet
// Simple HTTP Server and Tensor Processing example in Metor
let msg = "Hello from Metor AI Engine!"
print msg

fn handle_req() {
    send_http("HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\n\r\nHello from Metor Server!")
}

// Start the native server loop on port 8080
serve(8080)
🛡️ License
Distributed under the MIT License. See LICENSE for more information.

Build under AROM Labs

Releases

Packages

Contributors

Languages