Setup
This page covers end-to-end Mux setup, including runtime installs, compiler/tooling, and editor integration.
Language install
Compiler and runtime (prebuilt binaries)
The installer downloads a prebuilt compiler and runtime library, so you do not need Rust or the LLVM development libraries.
You do need a C compiler. Mux compiles your program to an object file and
then calls one to link it, so this is required to run anything, not just to
build from source. Any recent clang or gcc works and the version does not
need to match the LLVM the compiler was built against - the linker never
parses LLVM IR, only the object file:
- Debian/Ubuntu:
sudo apt-get install clang - Arch Linux:
sudo pacman -S clang - macOS:
xcode-select --install(the Command Line Tools ship clang) - Windows: install LLVM, for example via Chocolatey
The installer runs mux doctor when it finishes and tells you if anything is
missing. You can re-run that check at any time.
Linux and 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 install directories:
MUX_INSTALL_DIR=/usr/local/bin MUX_LIB_DIR=/usr/local/lib sh install.shCompiler and tooling (source builds)
For compiler development or source builds, you need LLVM 22 and clang. The bootstrap script installs the toolchain automatically.
git clone https://github.com/muxlang/mux-compiler
cd mux-compiler
./scripts/bootstrap-dev.sh
./scripts/dev-cargo.sh build -p mux-runtime -p mux-langBuild both packages. Compiled Mux programs link libmux_runtime.a, and cargo
emits a dependency's rlib but never its staticlib, so building only the compiler
leaves programs failing to link. scripts/run-checks.sh does this for you.
Verify installation
mux version
mux doctor
mux doctor --devSyntax highlighting
Mux ships TextMate and Tree-sitter grammars. Use the section that matches your editor.
TextMate family (VSCode, Sublime Text, JetBrains)
Generate grammar (required before packaging):
cd mux-syntax-highlighting
node scripts/generate-syntax.jsVSCode:
- Package the extension:
../scripts/release-syntax.sh - Install the
.vsix:code --install-extension language-mux-<version>.vsix - Reload VSCode.
Sublime Text:
- Copy
mux-syntax-highlighting/textmate-mux/source.mux.jsonintoPackages/User/Mux/. - Add to
Packages/User/Package.sublime-settings:{ "syntax": [ { "name": "Mux", "scope": "source.mux", "file_extensions": [".mux"], "path": "User/Mux/source.mux.json" } ] }
JetBrains (IntelliJ, WebStorm, etc.):
- Install the TextMate Bundles plugin.
- Import
mux-syntax-highlighting/textmate-mux/source.mux.json. - Associate
.muxfiles in Settings > Editor > File Types.
Tree-sitter family (Neovim, Helix)
Generate grammar (required before packaging):
cd mux-syntax-highlighting
node scripts/generate-syntax.jsNeovim:
- Install the parser and queries from
mux-syntax-highlighting/tree-sitter-mux/. - Add to
~/.config/nvim/init.lua:local parser_config = require "nvim-treesitter.parsers".get_parser_configs() parser_config.mux = { install_info = { url = "https://github.com/muxlang/tree-sitter-mux", files = {"src/parser.c"}, branch = "main" }, filetype = "mux", } - Run
:TSInstall muxand enable highlighting.
Helix:
- Build the parser:
mkdir -p ~/.config/helix/runtime/grammars cd mux-syntax-highlighting/tree-sitter-mux tree-sitter generate grammar.js cp mux.so ~/.config/helix/runtime/grammars/ - Add to
~/.config/helix/languages.toml:[[language]] name = "mux" scope = "source.mux" file-types = ["mux"] roots = [] grammar = true [language.highlight] paths = ["queries/highlights.scm"]
LSP
In development. There is no supported Mux LSP release yet.
Playground local development
To run the docs site and compiler API locally for playground testing:
- Start the API server from the repo root:
uv run python api/server.py- In a second terminal, start the website:
cd mux-website
npm startThe site runs on http://localhost:3000 and uses the production compile proxy
(https://mux-ai.corniedj.workers.dev) by default. The proxy keeps browser
traffic behind Cloudflare and authenticates its requests to the Fly origin.
To use your local API server instead, set this before starting the docs site:
MUX_API_URL=http://localhost:8080 npm startSet MUX_API_URL when running a local API directly. Production deployments
should keep the default Worker URL; do not expose the Fly origin to browser
code.
Profiling
Profiling is done with external tools so it stays decoupled from the compiler and runtime.
Linux:
perf+ flamegraph
macOS:
- Instruments
Windows:
- Windows Performance Analyzer or Visual Studio Profiler