---
name: x07-language-guide
description: Canonical X07 language + stdlib reference (mirrors `x07 guide` output) for end-user skill packs.
metadata:
  short-description: Language + stdlib guide
  version: 0.1.0
  kind: docs
---

# x07-language-guide

This skill provides the canonical language and stdlib reference generated by `x07 guide`.

## Canonical commands

- `x07 guide`: print the full language + stdlib guide.
- `x07 doc <id>`: look up a single symbol (builtin, stdlib function, diagnostic code, schema id).

## Key concepts to align on

- Loops: use `for` for counted loops and `while` for scanning/open-ended loops.
- Error propagation:
  - typed results (`result_i32`, `result_bytes`) use `try`
  - doc envelopes use `try_doc` (and return `bytes`)
- Version + compat:
  - prefer `project.compat` in `x07.json` as the stable default
  - use `x07 migrate --check/--write --to 0.5` for mechanical rewrites when upgrading older code
- Expressiveness floor (opt-in schema `x07.x07ast@0.9.0`, RFC 0002):
  - `f64` scalar with explicit conversions (`f64.of_i32`, `f64.to_i32_trunc`) and arithmetic
  - `defrecord` (nominal product types) and `defenum` + exhaustive `match` (tagged unions)
  - validated UTF-8 strings via the `std.str` module (`string` = bytes branded `std.str.utf8_v1`)
  - 0.8.0 programs stay valid; opt in per `schema_version`. Use `x07 doc <id>` for any new symbol

See `references/language-guide.md`.
