-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
Mike Wright edited this page Aug 1, 2026
·
2 revisions
The fastest start is the hosted browser playground. It runs the language and tutorials locally in WebAssembly and requires no account or install.
- Open the playground and stay on the REPL tab.
- Enter
1 + 2, then[1, 2, 3] * 10. - Enter
X : [batch, feat] = reshape(iota(6), [2, 3]). - Run
labels(X)andreduce_add(X, "feat"). - Pick a demo from Load Demo..., then open the Tutorial and
?documentation dialog.
flowchart TD
Open[Open playground] --> Try[Evaluate an expression]
Try --> Demo[Load a worked demo]
Demo --> Inspect[Inspect values and models]
Inspect --> Tutorial[Follow a learning path]
Tutorial --> Native{Need files, servers, or GPU?}
Native -->|No| Browser[Keep using browser mode]
Native -->|Yes| Build[Build a native workspace]
- A current Rust toolchain with Cargo.
- Git and ordinary platform build tools.
- Optional: Apple Silicon and the MLX build dependencies for MLX.
- Optional: Linux x86-64, an NVIDIA GPU, a compatible driver/toolkit, and the CUDA feature for CUDA.
The repository is a cellular monorepo made of several Cargo workspaces, not one root Cargo workspace. Run Cargo from the component that owns the binary or crate.
git clone https://github.com/sw-ml-study/sw-mlpl.git
cd sw-mlpl/components/cli
cargo build
cargo run -p mlpl-replRun a script from the CLI workspace while referring to the repository-level demo path:
cd sw-mlpl/components/cli
cargo run -p mlpl-repl -- -f ../../demos/basics.mlplUseful first commands inside the REPL:
:help
:vars
:builtins
:describe X
:models
:tags
:wsid
:version
X = [[0, 0], [0, 1], [1, 0], [1, 1]]
mdl = chain(linear(2, 4, 11), relu_layer(), linear(4, 2, 12))
scores = apply(mdl, X)
softmax(scores)
Use :describe mdl to see its structure and parameters. Continue with Language Tour for syntax and concepts, then Use Cases for complete workflows.
| Need | Recommended mode |
|---|---|
| Zero install, tutorials, inline visualization | Browser and WASM |
| Files, trace export, scripting, predictable native performance | Native CPU |
| Metal-backed work on an M-series Mac | Apple Silicon and MLX |
| CUDA-backed work on Linux/NVIDIA | NVIDIA and CUDA |
| Browser UI backed by native CPU or GPU | Server and Remote Execution |
- Browser mode cannot directly read arbitrary local files or spawn host processes.
- GPU scopes can fall back to CPU when a backend is absent or an accelerated training shape is unsupported. Read the backend page before interpreting a timing result.
- Small workloads may be faster on CPU because transfer and launch overhead dominate.
- Repository commands in older docs may show a former monolithic layout. In the current repository, use the owning component workspace.
Source references: README, usage guide, and REPL guide.