vyrn

Reference

53 modules and 438 exports, generated from the source in std/.

53 modules

Contents

  • The language

    19 chapters in reading order. Every code block is a program this site compiled and ran while it built.

    Read the guide

  • The standard library

    53 modules and 438 exports, each with its signatures and its tests.

    Browse the modules

  • The tools

    The driver, the formatter, the language server and the VS Code extension, in one repository.

    Set up your editor

  • Import graph

    126 imports between the modules, drawn from the import lines themselves. 20 import nothing else.

    See the graph

Text and bytes

  • std/codecs7Hex, base64 and percent encoding over UTF-8 bytes.
  • std/hash5Non-cryptographic byte hashing, and SHA-1 for the WebSocket handshake.
  • std/num5Text -> number, correctly rounded, and Float64 -> %f text.
  • std/scan15One comment- and string-aware cursor over foreign text (CSS, ICU messages, HTML templates, SDL) for generators.
  • std/strings19String helpers in Vyrn, over slice and bytes().
  • std/strpred10The string predicates and slice, written on the byte view (bytes, s[i], stringFromBytes).
  • std/text8UTF-8 decoding and byte-offset line and column, in Vyrn.

Data

  • std/arrays8Higher-order array helpers such as map, filter and fold, in Vyrn.
  • std/json11The JSON value tree and its canonical writer.
  • std/jsondec42The untyped half of fromJson, and the generator of the typed half.
  • std/jsonread21The strict JSON reader: parseJson, and the cursor fromJson reads with.
  • std/math16Integer helpers (min, max, abs, clamp) and Float64 functions (pi, rounding, sine, cosine, exp, log, pow, tan, atan2), written in Vyrn.
  • std/random6Deterministic pseudo-randomness with a host-seeded escape.
  • std/slots10A generational slab over Array, in Vyrn.
  • std/storage1Crash-safe persistence, where a save replaces the whole file or leaves the old one.
  • std/stream8The linear Stream<T> combinators, written in Vyrn.
  • std/symbolmap5The symbol map of a generated module: for each exported symbol, the source declaration it stands for and any derived facts.
  • std/von13VON, Vyrn Object Notation, Vyrn's literal grammar saved to a file.

Web

  • std/connect2Connect wire compatibility as a library, built on generator imports.
  • std/graphql12The contract as a GraphQL SDL document, built on generator imports.
  • std/html18The view tree and its string renderer.
  • std/http22The REST projection: hand-written routes over the same procedures the derived RPC surface reflects on.
  • std/i18n1Typed translations as a generator library.
  • std/icons5Inline SVG icons generated from a pinned Iconify collection, one function per named glyph.
  • std/openapi1The contract as an OpenAPI 3.1 document, built from generator imports.
  • std/rpc7Typed RPC as a library, built on generator imports.
  • std/tw1Theme-derived utility classes as a checked type.
  • std/ui28File-based routing as a generator: pages(dir) scans a directory of page modules at generation time and returns a router module.
  • std/vyx-hints2Accessibility, security and performance rules for .vyx components.
  • std/vyx7The .vyx single-file component compiler, in comptime-pure Vyrn.

Programs and tools

  • std/args7Command-line argument parsing over args(), in Vyrn.
  • std/bench9The runtime the vyrn bench transform links against.
  • std/cli4The command line is a record type, and cli writes its parser and help.
  • std/columns1A record type laid out as one array per field.
  • std/contract3Check a module against a module contract.
  • std/diag3A generator reports a diagnostic, anchored in a file it read.
  • std/fallible1Fallible: the protocol ? resolves through for a type that is not Option or Result.
  • std/hints8Policy for checking libraries: per-project rule levels and per-line waivers.
  • std/http.editor1Editor support for the generators std/http exports.
  • std/imports2The import block of a generated module.
  • std/json51A JSON5 reader that builds the Json tree of std/json.
  • std/narrow30Narrow number formats for storage: Float16, BFloat16, the two FP8 formats, the OCP MX blocks, the NVFP4 block and packed Int4.
  • std/order11Orders, the comparison under one, and the functions that sort by one.
  • std/proof1Comparisons the compiler proves where a call states them.
  • std/regex6A regular expression that searches, counts and replaces.
  • std/rpc.editor2Editor support for the generators std/rpc exports.
  • std/sum1The exact sum of an Array<Float64>, written in Vyrn.
  • std/task7Waiting for the host: sleep, the one host wait, and the run queue.
  • std/tile2Integer matrix tiles: mmaInt8 and mmaUInt8, the CPU oracle a GPU tile must equal bit for bit.
  • std/time15Wall-clock time at the host boundary, and a pure calendar breakdown.
  • std/tw.editor2Editor support for the theme modules std/tw writes.
  • std/ui.editor2Editor support for the .vyx pages std/ui claims.
  • std/vyx.editor3Editor support for the .vyx files std/vyx claims.

Commands

CommandWhat it does
vyrn run | check | build | test | benchRun, type-check, compile, and run the tests and benchmarks written in the file. Your first program.
vyrn fmt --checkThe canonical formatter. --check is the CI gate.
vyrn docMarkdown API docs from /// comments. The pages on this site are read off the same declarations.
vyrn why <file>Why the compiler decided what it decided. --cost and --contract narrow it. The chapter on ownership.
vyrn emit-gen <file>The source a generator produced.
vyrn serve | dev | routesAn HTTP host, the development server, and the resolved wire table.
vyrn new | add | update | vendor | depsProjects and modules. Remote imports pin in vyrn.lock and cache by sha256.

Further reading

The guide teaches the language in order. The registry lists what a project pulls in from outside std/.

  • ExamplesSingle-file programs, every one run on three engines.
  • READMEThe language in one page.
  • RoadmapThe open work, and what blocks each item.