Mux is a statically-typed, reference-counted programming language that combines Python's readability, Go's simplicity, and Rust's type safety into one cohesive package. Write fast, safe, and maintainable code without the complexity.
- Simple & Readable: Clean syntax without semicolons, Python-like readability with Go-inspired minimalism
- Type Safe: Strong static typing with no implicit conversions. Catch errors at compile time
- Fast & Native: LLVM-powered compilation delivers native performance
- Memory Safe: Reference-counted memory management provides safety without GC pauses or complex ownership
- Modern Features: Full-featured with generics, interfaces, tagged unions, and pattern matching
- Developer Friendly: Helpful error messages, built-in tooling, and comprehensive documentation
curl -fsSL https://raw.githubusercontent.com/muxlang/mux-compiler/main/scripts/install.sh | shFull installation guide | Other options
Create hello.mux:
func main() returns void {
print("Hello, Mux!")
}
Run it:
mux run hello.muxThe full language reference, guides, and standard-library docs live at mux-lang.dev:
- Getting Started - Installation and first steps
- Setup - Full install, editor setup, and tooling
- Language Guide - Complete language overview
- Reference - Lexical structure, expressions, statements, memory model
- Standard Library - Built-in modules and functions
For how the compiler and runtime work internally (design rationale, the value model, codegen, memory), see the muxlang/mux-context knowledge hub.
Choose the method that works best for you:
The fastest way to get started. No Rust and no LLVM development libraries
required - but you do need clang matching the linked LLVM major (22), since
Mux calls it to link every program it compiles. The installer runs mux doctor
when it finishes and names anything missing.
Linux & macOS:
curl -fsSL https://raw.githubusercontent.com/muxlang/mux-compiler/main/scripts/install.sh | shWindows (PowerShell):
iwr -useb https://raw.githubusercontent.com/muxlang/mux-compiler/main/scripts/install.ps1 | iexCustom installation directory:
MUX_INSTALL_DIR=/usr/local/bin MUX_LIB_DIR=/usr/local/lib sh install.shmux-lang was published to crates.io through 0.6.0. That channel is no longer
updated: cargo install mux-lang needs a Rust toolchain and the exact LLVM 22
development libraries, then compiles the LLVM bindings from scratch, making it
the slowest route to a working compiler. Use Option 1, or build from source
below.
For contributors and those who want the latest features:
git clone https://github.com/muxlang/mux-compiler
cd mux-compiler
./scripts/bootstrap-dev.sh # Installs LLVM 22 automatically
./scripts/dev-cargo.sh buildmux version # Check compiler and runtime versions
mux doctor # Validate runtime dependencies
mux doctor --dev # Validate LLVM 22 and clang for developmentMux combines familiar syntax with powerful features:
// Error handling with Result types
func divide(int a, int b) returns result<int, string> {
if b == 0 {
return err("division by zero")
}
return ok(a / b)
}
// Pattern matching with exhaustive checking
func main() returns void {
auto result = divide(10, 2)
match result {
ok(value) {
print("Result: " + value.to_string())
}
err(error) {
print("Error: " + error)
}
}
}
More examples: see test_scripts/ or the Language Guide.
.mux --> lexer --> parser --> semantics --> LLVM codegen --> .ll --> clang --> native binary
(links libmux_runtime)
The compiler emits LLVM IR and invokes clang to produce a native binary that
links the runtime (reference counting,
strings, collections, stdlib). Use mux run -i <file.mux> to view the generated
IR. The deeper design notes (value representation, monomorphization, the object
system, memory model) live in muxlang/mux-context.
Mux is an open-source project and welcomes contributions! Whether you're adding features, fixing bugs, improving documentation, or testing, your help is valuable.
- Read CONTRIBUTING.md for guidelines
- Check GitHub Issues for tasks
- Join GitHub Discussions for questions and ideas
Profiling is done with external tools so it stays decoupled from the compiler and runtime. See the Setup page for platform-specific guidance.
- Current Version: 0.6.0
The compiler version lives in mux-compiler/Cargo.toml (CARGO_PKG_VERSION) and is
the canonical "Mux version" - there is no separate version file.
- When releasing, bump
versioninmux-compiler/Cargo.toml, update the badge and the- **Current Version:**line above, then runcargo buildto refreshCargo.lock. - The runtime is a git dependency on muxlang/mux-runtime
main, pinned to one commit byCargo.lock;mux versionreports both, with the locked commit as build metadata. - Full release steps: muxlang/mux-context.
- License: MIT
- Maintainer: Derek Corniello
The runtime uses a unified representation for optional<T> and result<T, E> at the FFI level (boxed Value pointers). Compiler-generated code and FFI should treat optionals/results as *mut Value and use the runtime discriminant helpers when inspecting variants. See error-handling.
| Repo | What it is |
|---|---|
| mux-runtime | Runtime + standard library linked by compiled programs |
| mux-website | Docs site (mux-lang.dev) and the language reference |
| mux-website-api | Compile/run API behind the playground |
| tree-sitter-mux | Tree-sitter grammar + highlight queries |
| mux-syntax-highlighting | TextMate grammar, VSCode extension, canonical syntax spec |
| mux-context | Cross-repo architecture, design rationale, glossary, releases |
Mux is licensed under the MIT License.
