Skip to content

Repository files navigation

Mux Logo

mux-runtime

The runtime and standard library for Mux

License Documentation Sonar Quality Gate Coverage

Compiled Mux programs link against this library at compile time. It is plain, stable Rust with no LLVM dependency - so runtime and standard-library work needs only a Rust toolchain, not the compiler's LLVM 22 + clang setup.

crates.io is frozen. Versions through 0.5.0 remain published and are not yanked, but no new ones will be. mux-compiler consumes this repo as a git dependency on main, pinned to an exact commit by its Cargo.lock, so merging here is what makes a change available. See ADR 0004.


What's here

  • Memory allocation and reference counting
  • String operations (UTF-8)
  • Collections (list, map, set)
  • Type conversions and standard-library runtime support
  • Optional features: json, csv, net, sql, sync (see [features] in Cargo.toml; full enables everything and is the default)

Development

cargo build
cargo test --all-features
cargo clippy --all-targets --all-features -- -D warnings
cargo fmt

No LLVM or clang required.

Benchmarks for the hot paths (reference counting, list/map/set, string, JSON) live under benches/ and use criterion:

cargo bench                                  # run all hot-path benchmarks
cargo bench -- --save-baseline main          # save a baseline, then compare a change with
cargo bench -- --baseline main               # ... --baseline main

Benchmarks are a local/manual tool and a non-blocking CI report; they never gate a merge (shared CI runners are too noisy for a wall-clock threshold).


Relationship to the compiler

The compiler does not import this crate as Rust code - it links the built library when producing executables. It resolves this repo as a git dependency on main, pinned to an exact commit by its Cargo.lock, and links the archive cargo builds into its target/ directory. Producing that archive takes cargo build -p mux-runtime: cargo emits a dependency's rlib and never its staticlib.

For coupled local development, build this repo and point MUX_RUNTIME_LIB at the resulting target/debug/libmux_runtime.a. That is the first thing the compiler consults, so it overrides the library cargo built from the locked commit - which also means a leftover MUX_RUNTIME_LIB will keep overriding it until you unset it.

The compiler never builds this crate while compiling a Mux program, and always links the full feature set. Static linking discards archive members nothing references, so a program that does not touch sql carries no SQLite.


Versioning

The compiler identifies this repo by commit, not by version: mux version reports the locked commit as semver build metadata, e.g. runtime v0.5.0+g4e2dc14. A coupled change is one PR here and one in mux-compiler - no publish step between them.

The version field in Cargo.toml is inert while crates.io is frozen. Record changes under an ## [Unreleased] heading in the changelog instead.

Full release steps: muxlang/mux-context release process.


Related repositories

Repo What it is
mux-compiler The language, compiler, and CLI that links this runtime
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

License

MIT - Maintained by Derek Corniello

About

Runtime + stdlib for compiled Mux programs. Plain stable Rust, no LLVM. Published to crates.io.

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages