A programming language with a type system, functional features, and a stack-based bytecode VM.
Warning
Musi is v0.1.0-rc1. The language, tooling, and standard library will have breaking changes. Do not use it for anything you can't afford to rewrite.
Musi source files use the .ms extension. The toolchain has two binaries:
| Binary | What it does |
|---|---|
musi |
Universal driver - run, check, build, test, format, lint, manage projects |
msc |
Standalone compiler - type-check and compile without the VM |
You will mostly use musi. The msc binary is for compiler-only workflows (CI type-checking, producing .seam bytecode without running it).
# install
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# or update
rustup update stable
# verify
rustc --versionMusi uses libffi for its foreign function interface.
macOS:
brew install libffiUbuntu / Debian:
sudo apt install libffi-devFedora / RHEL:
sudo dnf install libffi-develYou probably already have this. If not: https://git-scm.com/downloads
There are no pre-built binaries yet.
git clone https://github.com/musi-lang/musi.git
cd musi
cargo build --releaseBinaries land in ./target/release/:
musi(toolchain driver)msc(standalone compiler)msc_lsp(LSP server)
Add to your PATH:
export PATH="/path/to/musi/target/release:$PATH"musi new hello
cd helloThis creates:
hello/
musi.json project manifest
index.ms source file
.gitignore
Look at the generated index.ms:
import "@std/rt" as rt;
rt.writeln("hello, world!");
Run it:
musi runOther commands:
musi check # type-check without running
musi build # compile to .seam bytecode
musi exec index.seam # run compiled bytecode directly
musi test # discover and run *.test.ms files
musi fmt # format source files
musi lint # lint source filesTODO
| Crate | Role |
|---|---|
msc |
Compiler library + CLI |
musi |
Toolchain driver CLI |
msc_lsp |
LSP server |
msc_shared |
Spans, source database, interner, diagnostics |
msc_lex |
Lexer |
msc_ast |
AST node types |
msc_parse |
Parser |
msc_sema |
Semantic analysis / type-checker |
msc_resolve |
Module resolution |
msc_emit |
Bytecode emitter |
msc_bc |
Bytecode format definitions |
msc_vm |
Bytecode interpreter / VM |
msc_builtins |
Standard library runtime + FFI |
msc_manifest |
musi.json parser |
The msc_lsp binary is built alongside the compiler. Point your editor's LSP client at it. A VS Code extension is in development at tools/vscode/.
cargo test -p msc_parse # test a specific crate
cargo clippy -p msc_parse # lint a specific crate
musi test # run Musi stdlib testsAvoid cargo test --workspace on machines with less than 16 GB of free RAM.
See CONTRIBUTING.md for the full development guide.
Contributions welcome. See CONTRIBUTING.md for workflow, coding guidelines, and the PR checklist.
All contributors are expected to follow the Code of Conduct.
MIT OR Apache-2.0 - see LICENSE for details.