Lane documentation

A syntax tour of Lane for people, and a set of plain-Markdown pages for agents.

Markdown version of this page

Lane is a data-oriented systems language. This tour follows the language specification and shows only code that really exists: programs from the compiler's test suite, the standard library, and syntax examples that the parser accepts.

use io;

nul main() {
    io.print("hello, world\n");
}

#Verified examples

A program that the compiler's test suite builds is marked "Verified: builds and runs". The page shows the standard output and exit code the suite expects, read from the test when this site is built, so the claim is checked at every build. A program that the compiler must refuse is marked "Verified" with the compiler's message.

Which constructs the current compiler accepts is listed, with a date, in the Status section of the agent docs. The roadmap has what comes next.

#The tour

  1. Types and literals: scalars, wrapping arithmetic, literals that take their type from context, no implicit conversions.
  2. Declarations and functions: type-first declarations, access modes (wr, out), several results, variadic parameters, function types.
  3. Statements and control flow: if, the three kinds of for, brk, nxt, ret, defer, scopes.
  4. Records, enums and match: C layout, copying, enums as u32, exhaustive match.
  5. Constants: exact compile-time arithmetic, typed and untyped constants.
  6. Memory: pointers, slices, arrays, arenas, and why there is no new.
  7. Data layout, SIMD and threads: soa, aos, vector types, vec, par.
  8. Per-ISA code, hints and floats: when, hints, @fp.
  9. Contracts: assume and examples.
  10. Modules and the standard library: use, pub, ext, io, fmt, mem, os, bufio.
  11. The lane command and its tests.

#For agents

The pages under For agents are written to be read by a program: plain Markdown, no JavaScript needed, with a one-page cheat sheet of the rules that are easy to get wrong, the verified examples and the error reference. /llms.txt indexes them and /llms-full.txt is the whole reference in one file. Every page here also has a Markdown twin: add .md to its path.