Skip to content
Systems programming for what’s next.
— Vex

Why Vex? ​

Vex brings ownership, concurrency, typed compile-time programming, and data-parallel operations into one systems language. Its value is in how these features work together: the same program can expose a small application API and still express storage lifetimes, native interfaces, and target-specific computation where those details matter.

This guide helps you evaluate that model for a project. The capability map connects the 0.4.0 language surface to its guides. The example collection shows how those features work together in concrete programs.

Make state changes visible ​

Immutable bindings are the default. Use let! for a binding that changes and &T! for a mutable borrow. Ownership and borrowing connect a function's interface to the lifetime of the values it accesses.

This matters when a program passes a buffer through several layers: a reader can distinguish ownership transfer, a temporary view, and permission to modify the owner. A Span<T> remains a view rather than an allocation or a lifetime extension; a raw pointer requires additional reasoning at the unsafe boundary.

Start with Ownership, Borrowing, and Span.

Keep application code and systems code in the same language ​

Structs, enums, generics, and contracts provide ordinary data modeling and reusable interfaces. Option and Result make absence and recoverable failure part of those interfaces. Native providers and typed pointers cover interoperability without making every caller manage an ABI.

For example, an application-facing wrapper can validate input, call a native library, and convert its result into a Vex value. The wrapper still needs an explicit ownership and cleanup contract; selecting an FFI provider does not make foreign memory safe automatically.

Follow Your first project, then Error handling and Your first native call.

Describe concurrency and its lifetime together ​

go, channels, async fn, and await let you describe concurrent work in Vex. A useful design also says who owns each task's input, how results are collected, and what happens on cancellation or shutdown.

Channels are useful when transferring work or results between tasks. Async functions are useful when an operation may suspend. Neither construct alone establishes a throughput improvement or freedom from deadlock: capacity, ordering, shared state, and the runtime on the selected target still matter.

The concurrency guide introduces the model; fan-in develops a concrete completion and cancellation flow.

Express data parallelism without promising a machine instruction ​

Arrays, tensors, masks, and graph functions expose operations that the compiler can lower through Silicon IR. This makes shape and elementwise intent visible before machine-specific lowering.

The generated code depends on element type, dimensions, dependencies, optimization settings, and backend. An array expression is not a promise of one SIMD instruction, and a graph function is not proof that a workload ran on a GPU. Compare outputs with a scalar reference, then inspect or measure the target path you intend to use.

See SIMD and tensors, GPU graph functions, and benchmarking.

Reuse typed semantics at compile time ​

Compile-time evaluation and structural declaration generation allow a program to compute values and generate typed declarations within explicit boundaries. This can eliminate repeated declaration boilerplate while retaining normal type checking. It also introduces a build-time cost that should be measured when generation becomes large.

Start with Compile-time evaluation and continue to Structural declaration generation.

Evaluate Vex for your project ​

Your requirementWhat to investigate
A command-line applicationComplete the first-project flow, then check the required file, process, and text APIs on the deployment platform.
A network serviceCheck the HTTP/TLS API subset, concurrency behavior, cancellation, resource limits, and protocol tests your service needs.
A compute pipelineEstablish reference outputs and numeric tolerances before comparing CPU or GPU throughput.
A native-library integrationVerify target ABI, artifact packaging, ownership, callbacks, and shutdown using the actual library version.
Reusable librariesReview generic constraints, exported types, error behavior, and source compatibility for the selected compiler.
An existing codebaseCompare the integration and migration cost with the specific benefit Vex would provide.

A representative vertical slice is more useful than a language feature score: build a small part of the intended application, exercise its failure paths, and retain the compiler version, target, inputs, and results. Use the same algorithm and workload when comparing another implementation. Compiler architecture, absence of a tracing collector, and source brevity are not substitutes for measured compile time, latency, memory use, or binary size.

Further reading ​

Released under the MIT License.