The easiest way to install Mech is to use the installer provided for your platform. The installer includes the mech
command-line tool, which is a standalone executable that includes everything you need to get started with Mech.
Windows - x86-64
Right now, the installer is only available for Windows, but we are working on providing installers for other platforms in the future.
Mech is easy to install without the installer -- the whole toolchain is just a single binary executable file.
Precompiled binaries are available for the following platforms:
OS | Architecture |
---|---|
Wndows | |
Linux | |
macOS | |
Web |
You can find previous releases and release notes at /mech-lang/mech/releases.
To install, download the appropriate binary for your operating system and extract it to a directory of your choice. The Mech toolchain is distributed as a singular executable file and doesn't require an installer.
See the toolchain documation for more information on how this program works.
If mech is not available for your platform, or if you want to build it from source, follow these steps:
First you will need Rust. Make sure to install a recent version on the nightly release channel, currently nightly-2025-01-15
.
In Bash:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --profile minimal --default-toolchain nightly-2025-01-15
This command will download and install the Rust toolchain, including Cargo, the Rust package manager. Rustup is a tool for managing Rust versions and associated tools.
In PowerShell:
irm https://win.rustup.rs -OutFile rustup-init.exe; Start-Process -Wait -FilePath .\rustup-init.exe -ArgumentList "-y --default-toolchain nightly-2025-01-15"; Remove-Item .\rustup-init.exe
This command will:
Download Rustup for Windows (rustup-init.exe)
Run the installer with -y
("yes" to all, no prompts) and set the correct nightly toolchain
Delete the installer after completion
You may need to allow scripts by running the following before executing the above command:
Set-ExecutionPolicy Bypass -Scope Process -Force
git clone https://gitlab.com/mech-lang/mech cd mech cargo build --bin mech --release
If you want to build the WebAssembly target, you will need to install the wasm-pack
tool. You can do this using Cargo:
cargo install wasm-pack
Then, navigate to the wasm
directory and build the target:
cd mech\src\wasm wasm-pack build --target web
If you prefer to install Mech using Rust's Cargo package manager, you can use the following commands, first install Rust as described above. Then run:
cargo install mech
This will download the lasted version of Mech published to the cargo package manager, found here: https://crates.io/crates/mech.
After installation, confirm that Mech is installed correctly by running:
mech --version