x-lang: computational expressions over a minimal, type-agnostic engine.
A dialect is a composition of x-lang library modules that determines what capabilities are loaded. The dialects are named after noble gases — the theme ties to the x-expr/Xe etymology, and read correctly it is self-teaching along the two axes that actually distinguish the entries:
| Name | Element | Is |
|---|---|---|
| — | — | ./x-bin, the engine binary: no libraries, substrate rather than a dialect |
he |
helium | light, fast boot, interactive; no tower — the default |
xe |
xenon | full numeric tower, POSIX, compiler; stable |
rn |
radon | xenon’s surface plus experimental/raw APIs; explicitly volatile |
The rule that shapes the family: dialects may differ in what surface is loaded; they must never differ in what a shared spelling means. A + that means pointer arithmetic in one dialect, or a + that coerces "123" to a number, is not a dialect — it is a different language wearing the same clothes (that would be a lang, below). If radon ever grows ergonomic address math, it gets a distinct spelling (the Ptr class), not an overload.
The interpreter core has no knowledge of any dialect. Dialects are loaded by shell concatenation before user input. The shell wrapper (x.sh) selects a dialect with the -l flag:
sh x.sh # helium (default)
sh x.sh -l xe # xenon
sh x.sh -l rn # radon
Or directly:
cat lib/he.x - | ./x-bin # helium
cat lib/xe.x - | ./x-bin # xenon
cat lib/rn.x - | ./x-bin # radon
In an installed tree (make install) the wrapper boots the same dialects
from share/x/boot/ — one generated, amalgamated entry per dialect (the raw
include chain flattened to a single stream) — and
the library under share/x/lib/ is byte-identical to the repo’s. Repo
checkouts always load the live entries above.
lib/x.x is a pointer, not a dialect: it is what a bare sh x.sh boots, and it currently points at helium. The default stays light on purpose — xenon’s boot runs eight runtime cc compilations (the compiled tokenizer analysers), which would make every newcomer run slow and host-toolchain-dependent. The pre-0.3.0 spellings x-and/x-or are retired (see the CHANGELOG); an unknown -l name fails with the wrapper’s inventory listing, which names the real entries.
lib/he.x)The light dialect. Loads lib/x-core.x, which bootstraps the module system and loads 40+ modules:
provide/import)cond, case, when, unless, letrec), association lists, arithmetic, quasiquote, REPL, bannerHelium provides everything needed for general-purpose programming: combinators, list processing, sorting, pattern matching, strings, vectors, lazy evaluation, and an interactive REPL. It has no numeric tower beyond built-in integers, no POSIX access, and no file I/O.
lib/xe.x)Stable full-stack dialect. Includes all of helium’s surface, then adds:
x/sys/posix.x) — fork, exec, pipe, dup2, wait, open, close, read, write, chdir, getenv, setenv via FFIx/type/hash.x) — FNV-1a hash function for stringsx/type/dict.x) — content-hashed mutable hash table (symbol, string, integer, and char keys); the common container, loaded by default in both tower dialectsx/tool/compile.x) — Compiles x-lang functions by emitting C, invoking a host cc at runtime, and dlopening the result. Requires a C toolchain on the machine running it. (The separate data-driven assembler — x/tool/asm.x, emitting machine code directly on ARM64 and x86_64 — is not loaded by this dialect.)Then loads the numeric tower with immediate analyser compilation (the shared
block lib/x/boot/tower-compiled.x, included by every full-tower
composition — x-base.x and the xenon/radon bodies):
x/num/bigint.x) — Arbitrary-precision integers. Analysers for bigint and int-capped types are compiled to native code immediately after loading.x/type/regex.x) — Regular expressions with #/pattern/ literal syntax. Uses a C-level analyser, no compilation needed.x/num/float.x) — IEEE 754 floating-point. Analyser compiled after loading.x/num/rational.x) — Exact rationals. Analyser compiled after loading.x/num/complex.x) — Complex numbers with rectangular and polar forms. Analyser compiled after loading.x/num/decimal.x) — Arbitrary-precision decimal floating-point, literal suffix d (1.5d). Analyser compiled after loading. Last on purpose: its conversions declare float, rational and complex, and its analyser only claims a digit run that ends in d, so it never contests a token the earlier readers want.The analyser compilation pattern is the key design choice: each numeric type’s tokenizer analyser is compiled to native code right after the type loads, so subsequent source files (including later numeric types) are parsed through fast compiled analysers rather than interpreted ones.
Xenon does NOT include raw syscall access, file I/O, or socket constants.
lib/rn.x)Experimental/hacking dialect. Everything in xenon, plus:
x/platform/syscall.x) — Symbolic syscall number lookup for x86_64 and i386/BSD (loaded via the POSIX layer)x/sys/file.x) — File operations via POSIX syscalls with symbolic mode flags. Opt-in (#36): (import x/sys/file)x/platform/socket.x) — Linux socketcall, protocol families, socket types. Opt-in (#36): (import x/platform/socket)#newline/#nl, #cr, #esc, #0, #crnlstdin (0), stdout (1), stderr (2), current-input-handle, current-output-handle, current-error-handlecaar through cddddrsystem — Execute a shell command via fork/execvedo-loop — Scheme-style iteration formRadon is the right choice for systems programming, kernel hacking, or any task that needs direct access to the operating system. It is chemically honest: heavy AND radioactive — full-featured and explicitly unstable. APIs here may change or vanish between releases.
Langs are loaded as additional libraries on top of a dialect, aliasing x-lang primitives and adding derived forms to emulate another language’s syntax. This is where same-spelling-different-meaning belongs: a lang may claim any spelling it likes, because it announces itself as a different language.
| Lang | Base Dialect | Description |
|---|---|---|
| R5RS Scheme | helium | lambda, cons/car/cdr, define, cond, case |
| R7RS Scheme | R5RS | do, case-lambda, delay/force, values, define-record-type |
| Kernel | helium | $vau (operative-first), $define!, $lambda via wrap |
| ASH Shell | helium | POSIX shell syntax: pipes, redirections, if/while/for/case |
| Sweet Expressions | helium | SRFI-105/110: curly-infix + indentation-sensitive syntax |
Langs are maintained as sibling projects and load by concatenation on top of a dialect:
cat lib/he.x path/to/r5rs.x - | ./x-bin
The interpreter core has no knowledge of any lang. All lang semantics are implemented in x-lang library code.