Skip to content

Execution Surfaces

Mike Wright edited this page Aug 1, 2026 · 2 revisions

Execution Surfaces

MLPL is one language exposed through several clients and deployment shapes. A surface is how a user interacts; a backend is where computation happens.

flowchart TD
    User[User] --> WebLocal[Browser playground]
    User --> CLI[Native REPL or script]
    User --> WebRemote[Connected browser]
    User --> Rust[Embedded or compiled Rust]
    WebLocal --> WASM[In-browser WASM evaluator]
    CLI --> Local[Local evaluator]
    WebRemote --> Serve[mlpl-serve session]
    Rust --> Native[Native runtime subset]
    Local --> Devices[CPU, MLX, or CUDA]
    Serve --> Devices
Loading
Surface State lives in Main strengths Main limits
Browser-only playground Browser memory No install, tutorials, inline UI and visualization No arbitrary local files, host processes, or direct native GPU
Native REPL Local process Full REPL, files, traces, scripts, optional native GPU Single local client and terminal-oriented output
Script execution Local process Repeatable .mlpl programs and demos Non-interactive unless instrumented
Connected terminal Server session Remote compute and persistent shared state Depends on server endpoints and network
Connected browser Server session Browser UI with native CPU/GPU compute Must configure connection, auth, CORS, and device availability
mlpl! embedding Rust host process MLPL expressions inside Rust Supported compilation subset
mlpl build Native binary No parser/interpreter in result Supported lowering subset, fewer dynamic features

Browser-only versus connected browser

These look similar but are operationally different. Browser-only evaluation happens inside WASM on the user's CPU. Connected evaluation sends programs to mlpl-serve; that server may have filesystem access, persistent state, MLX, or CUDA. The UI should probe /v1/devices and only enable demos supported by the connected build.

Local versus service-backed accelerators

MLX can be compiled in-process and also has a peer-service design. CUDA currently has an in-process connected-server vertical slice: the CUDA machine runs mlpl-serve --features cuda, and clients send work to it. Whole device-scoped programs reduce network chatter; device tensors should remain remote until explicit materialization where the peer-handle path is used.

Continue with Capability Matrix to compare features, or select Browser and WASM, Native CPU, Apple Silicon and MLX, or NVIDIA and CUDA.

Clone this wiki locally