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

Your first standard-library workflow ​

You do not need to read the entire library before writing a useful program. Start with one input, one transformation and an observable result. This path assumes you have completed your first Vex project.

Build confidence in three steps ​

StepDo thisYou are ready to continue when
Parse a valueRun the complete checked JSON example and print the resultYou can change a field and explain how parse failure reaches the caller
Transform itUse checked string conversion and string construction for the value you needYou can handle a missing or invalid field without inventing a default
Keep it workingPut the expected result and a rejected input into a testThe test detects a deliberate change to the expected behavior

Run each complete example before combining packages. Retain its imports and expected output. When the guide marks a snippet as a fragment, read the surrounding setup rather than pasting it as an independent program.

Choose the next package by the job ​

I want to…Start hereDecide before connecting it
Read arguments and print a resultCLI, loggingRequired versus optional input; output intended for people or machines
Read a configuration fileFiles, serdeWho owns the bytes, size limits, and required fields
Order or search recordsSort, collectionsKey type, ordering and whether stable order matters
Call an HTTP endpointHTTP, contextResponse ownership, deadline and failure handling
Store local recordsDatabaseConnection lifetime, statement errors and the native provider
Parse a URL or encoded textURL, encodingAccepted syntax and whether the returned data owns its storage
Measure elapsed workTimeMonotonic elapsed time versus a wall-clock timestamp

Use the complete package map for media, numerical work, cryptography and language tooling. Read the particular package's provider and integration requirements before extending a small example to a full service.

Keep three boundaries visible ​

Imports. Vec, Map, Option and Result belong to the prelude. Import packages using their documented paths, such as "fs" or "serde/json". The prelude and package guide explains which names need imports.

Ownership. An owning result can outlive its input; a view needs its owner. Check the receiver and return type before storing or returning a value. Use ownership workflows when connecting two APIs across a function, collection or async boundary.

Validation. Successful parsing establishes the format contract. Your application still checks required fields, value types and ranges. For a binary format, follow the safe dynamic path described by CBOR or MessagePack before constructing domain values.

A small exercise ​

Adapt the JSON example to accept a configuration with an enabled boolean. Keep one accepted input and reject both a missing field and a string in place of the boolean. Print a result only after validation. Then move the validation into a function and test it. Your completion check is the same behavior before and after that refactor, including the two rejected inputs.

For a larger next step, choose one worked application example. Keep the compiler identity and commands with your result using verification evidence.

Released under the MIT License.