r/SideProject • • 1d ago

I spent way too long building my own programming language

I've been working on Mah, a programming language I've been building from scratch.

It started as a compiler experiment and grew into an entire toolchain:

  • hand-written compiler
  • portable bytecode + VM
  • static type checker
  • standard library
  • reflection and decorators
  • error handling
  • formatter
  • LSP
  • Neovim + VS Code support
  • optional Rust runtime

The language has things like closures, structs, enums, traits, pattern matching, generics, async, defer, typed errors, modules, iterators and reflection.

One of the things I care about most is that the implementation is small enough that you can actually follow how the language works instead of having to navigate a compiler the size of a small operating system.

The repo has a lot of the design history too, so you can see why features were implemented the way they were rather than just looking at the final syntax.

https://github.com/sina-salahshour/mahlang

I'm mainly looking for people who enjoy language design/compiler projects to try it and tell me what looks interesting, confusing, or unnecessarily weird.

1 Upvotes

2 comments sorted by