Quick Start

Write and run your first Tensor program in 5 minutes.

Quick Install (Recommended)

One command to install MIND with all dependencies:

curl -fsSL https://mindlang.dev/install.sh | sh

This will install Rust (if needed), clone the repo, build the compiler, and add mind to your PATH.

Manual Installation

Alternatively, build from source manually:

1. Clone & build the compiler

Use the public compiler repo and build the CLI from source:

git clone https://github.com/star-ga/mind.git
cd mind
cargo build --release --bin mindc

2. Inspect the sample program

The repository ships with examples/hello_tensor.mind, a minimal scalar smoke that parses and executes on the v0.10.x compiler line. Emit the typed SSA IR directly from the CLI:

cargo run --bin mindc -- examples/hello_tensor.mind --emit-ir

Expected output: a small module { ... } block ending with next_id = 1. This is the canonical mic@1 textual serialisation of the IRModule data shape; the same shape also serialises to canonical mic@3 binary (RFC 0021), with both forms round-trip equivalent and shareable across substrates.

3. Try the gradient IR

Autodiff is feature-gated; pass --features autodiff to cargo:

cargo run --features autodiff --bin mindc -- examples/hello_tensor.mind --func main --autodiff --emit-grad-ir

Autodiff currently runs on main; use --func main. Pure-MIND standard-library demos (std.vec, std.string, std.map, std.io) require the cross-module-imports feature; std-surface is the shipped default in mindc v0.10.x and requires no opt-in flag.

4. MLIR lowering (preview)

MLIR lowering is feature-gated and currently supports the tensor IR subset. The scalar smoke above will refuse to lower (the MLIR pass returns unsupported instruction: BinOp for scalar f64 math today); use a tensor program from examples/zoo/ or wait for the upcoming scalar-MLIR pass.

# Feature-gated; tracking issue: MLIR scalar lowering
cargo run --features "mlir-lowering autodiff" --bin mindc -- examples/hello_tensor.mind --func main --autodiff --emit-mlir