ral
A shell where data stays data.
Capture output without turning it back into source code.
A value is.
Strings, lists, records. Keep them, pass them, transform them.
A command does.
Work in the world. Capture its output, handle its failure, bound its authority.
say which world you mean
Traditional shells make text serve as data, command name, and source
code. ral refuses that ambiguity. $ reads a
value; ! runs a stored command. Once output has
become a value, the shell never splits it, expands it, or executes it by
surprise.
one task, two contracts
Fetch JSON from many URLs in parallel and keep every
outcome. A string shell needs a text protocol between workers. In ral,
each worker returns an ordinary value: ok or err,
ready to write as one report.
# invent a text protocol; parse it later
xargs -P8 -I{} sh -c '
body=$(curl -fsSL "$1") &&
printf "ok\t%s\t%s\n" "$1" "$body" ||
printf "err\t%s\n" "$1"
' sh {} < urls.txt > manifest.tsv
let urls = from-lines-list 'urls.txt' let report = par { |u| try { let data = curl -fsSL $u | from-json return [url: $u, result: `ok $data] } { |e| return [url: $u, result: `err $e[message]] } } $urls 8 to-json $report > 'manifest.json'
less shell to remember
ral's value language is small, typed, and purely functional. Bindings do
not mutate. Lists and records are values, not encodings. Use
map, filter, and fold instead of
arranging a procession of text filters.
Parallel work needs no shared mutable state. Give par a
block and a collection; its workers return values in input order. Decode
bytes at an explicit boundary with from-json,
from-lines, or another codec.
Commands remain visible as effects on the world. Their output can be
captured, their failure handled, their interpretation replaced, and their
authority narrowed with grant. An audit records the commands
that ran and the permissions under which they ran.
get ral
curl -fsSL https://lambdabetaeta.github.io/ral/scripts/install.sh | sh
one idea, followed through
The value–command split is call-by-push-value (Levy). Running an external command is an algebraic effect (Plotkin and Power): an operation whose interpretation can be handled, audited, or confined. The specification says what ral does; the rationale says why. ral runs Unix programs, but it is not POSIX shell — Bash scripts do not run unchanged.