A small Flask service that runs submitted Mux programs with the released mux
binary and returns their output. Hosted on Fly.io as
mux-lang-api (mux-lang-api.fly.dev), consumed by
mux-website over HTTP.
POST /api/compilewith{ "code": "<mux source>" }->{ "output": "..." }GET /healthfor health checks- The service shells out to
mux run(rate-limited, time-limited) and returns stdout/stderr.
The Dockerfile installs a released mux binary (no Rust/LLVM build),
pinned via ARG MUX_VERSION. The playground therefore runs a known, deliberately
chosen compiler release. To upgrade the playground:
- Ensure the target version is released in
mux-compiler (the
mux-linux-x86_64.tar.gzasset must exist). - Bump
MUX_VERSIONin theDockerfile. - Deploy (below).
The release pin above is intentional: the playground must run a stable released
compiler, not arbitrary main. To catch a compiler-main regression that would
break this API's contract before the next release bump, a scheduled
.github/workflows/canary-compiler-main.yml job builds mux from
mux-compiler main and runs a smoke
test (tests/canary_smoke.py) against it.
It runs only on a nightly schedule and manual dispatch (never on push or pull
request), so it does not gate normal CI or deploys and is not a required check.
It never changes the MUX_VERSION pin.
pip install -r requirements.txt
# Needs a `mux` binary on PATH (see the mux-compiler install instructions).
MUX_BIN=mux gunicorn --bind 0.0.0.0:8080 server:appOr build/run the production image (matches Fly):
docker build -t mux-website-api .
docker run --rm -p 8080:8080 mux-website-apifly deployThe slim image bundles clang-22 + the LLVM runtime libraries (the compiler shells
out to clang and links LLVM at compile time) and sets MUX_RUNTIME_LIB so it
never tries to build the runtime from source.
| Repo | What it is |
|---|---|
| mux-compiler | The language and compiler whose release this serves |
| mux-runtime | Runtime + standard library linked by compiled programs |
| mux-website | Docs site (mux-lang.dev) and playground UI |
| 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 |
MIT - Maintained by Derek Corniello
