Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Marrow is a fast, self-hosted, systems programming language Marrow is a fast, self-hosted, systems programming language

A fast, low-level, self-hosted systems programming language.

Important

The project is still under active development and is not ready for production use.

🧬 Why "Marrow"?

Bone marrow is the living biological matrix nested deep within bones. It is responsible for generating the core vital cells necessary for the entire organism to function and thrive.

Marrow was built on that exact philosophy: to serve as an ultra-lightweight, close-to-the-metal ("close-to-the-bone") system matrix. It provides a solid and expressive foundation for building softwares without the overhead of modern heavy runtimes.

⚡ Key Features

  • Self-Hosted: The Marrow compiler is written in Marrow (currently in Rust but WIP).
  • QBE Backend: Leverages QBE as an intermediate representation (IR) code generator for blazingly fast compilation and a minimal footprint.
  • Arena Memory Allocation: Explicit and ultra-performant memory management by default.
  • Zero Runtime / Freestanding: No garbage collector, no hidden runtime cost.
  • Clean Syntax: Strongly and explicitly typed language inspired by C and Rust.

💻 Code example

@import("std/std.mrw")

@export fn main (argc: i32, argv: rawptr) -> i32 {
    printn("Hello from Marrow !");

    print("Received arg count: ");
    println_i64(cast(i64) argc);

    ret 0;
};

🏗️ Architecture & How It Works Under the Hood

Marrow is designed modularly to ensure fast compilation times and a clean codebase that is easy to evolve:

  Source Code (.mrw)
         │
         ▼
 ┌──────────────┐
 │    Lexer     │  --> Tokenization & Keyword Lookup (ArrayMap)
 └──────┬───────┘
        │
        ▼
 ┌──────────────┐
 │    Parser    │  --> Abstract Syntax Tree (AST) & Arena Allocations
 └──────┬───────┘
        │
        ▼
 ┌──────────────┐
 │  SymTable    │  --> Symbol Resolution & Scopes (LinearMap)
 └──────┬───────┘
        │
        ▼
 ┌──────────────┐
 │   Codegen    │  --> QBE IR Generation (.qbe)
 └──────┬───────┘
        │
        ▼
 ┌──────────────┐
 │ QBE + Linker │  --> Assembly Code (.s) ──> Executable / Binary
 └──────────────┘

🗺️ Roadmap to Self-Hosting

  • CLI & Arguments: Full argc / argv support.
  • Standard Library: Arena Allocator, VecPtr, HashMap (DJB2), LinearMap, and ArrayMap.
  • Lexer / Tokenizer: Lexical analysis and symbol scanner.
  • Parser & AST: Abstract Syntax Tree construction.
  • Symbol Table: Scope handling and type checking.
  • QBE Codegen: IR generation targeting the QBE backend.
  • Full Self-Hosting: Recompiling the compiler using itself (marrow_v1 compiles marrow_v2).

Thanks to all contributors ❤️

About

A low-level, self-hosted systems programming language built close to the bone.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages