Skip to content

Hana-Works/megumi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Megumi: A Swift-like systems language

Megumi is a systems programming language that doesn't feel like one. I wanted to see if we could take the clean, readable syntax of Swift and pair it with the strict memory safety and performance of Rust.

It’s built for everything from high-level apps to low-level stuff like drivers and engines. No garbage collector, just fast machine code and a borrow checker that keeps you out of trouble.

Why use it?

  • Actually readable: If you've used Swift, the let/var bindings, guard statements, and do-catch blocks will look familiar.
  • Fast by default: We use LLVM 18 under the hood. You get direct machine code with zero-cost abstractions.
  • Safe memory: Like Rust, Megumi uses an ownership and borrowing model. It catches data races and null pointers before you even run your code.
  • Modern kit: Generics, Traits, Pattern Matching, and Async/Await are all baked in from day one.
  • Close to the metal: When safety gets in the way, use unsafe blocks, raw pointers, or call C functions directly with our FFI.

Quick Start

Build the compiler

You'll need CMake and LLVM 18 installed.

cmake -B build
cmake --build build

Your first program

Create hello.megumi:

fn main() {
    print("Hello, Megumi!")
}

Compile and run it:

./build/megumic hello.megumi

Status

We're still early. The Lexer, AST, and Parser are done, so the compiler understands the language perfectly. Right now, I'm working on the Semantic Analysis phase (type checking and the "brain" of the compiler).

License

Megumi is released under the MIT License. Check the LICENSE file for the legal bits.

About

General Purpose Language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published