M Monster Docs

Pipeline

.mnst source
  -> lexer
  -> parser
  -> AST
  -> semantic analysis
  -> LLVM IR
  -> opt-18 (default -O2)
  -> clang-18
  -> native binary
  • Compiler executable: mst
  • Source extension: .mnst
  • Docs site: suitable for GitHub Pages and editor help links

Guides

Install

Release installer, source install, supported platforms, and update workflow.

Language

Core syntax, types, control flow, enums, pointers, imports, and builtins.

CLI

init, check, emit-llvm, build, run, project manifests, and debug builds.

Examples

Working samples for argv, file I/O, module aliases, enums, match, and byte utilities.

Current Feature Areas

  • Core syntax: fn, extern fn, const, let, let mut, defer, if, while, break, continue, return
  • Types: i32, u8, usize, bool, str, void
  • Data structures: arrays, slices, structs, enums, payload enums, pointers
  • Utilities: sizeof(T), casts with as, argc/argv, file I/O, string and byte helpers, plus early importable std/mem.mnst, std/str.mnst, and std/vec_i32.mnst modules
  • Tooling: project manifests, LLVM IR emission, optimized builds, debug builds, static docs, a VS Code extension, and early self-hosting experiments

Self-Hosting

The first self-hosting slice lives in selfhost/. It is a Monster-written lexer prototype that reads Monster source with read_file and builds a token buffer with token kinds close to the Rust lexer.

mst run selfhost/main.mnst -- exam.mnst

Quick Example

fn main() -> i32 {
    print_ln_str("Hello, World!");
    return 0;
}