In a browser page
In the terminalela --spec in-a-browser-page
The tutorial on ela.run runs a script in the reader's browser, on
ela's own interpreter and --explain table, built from ela's source for
WebAssembly by the ela-wasm repository, with
Odin's js_wasm32 target. The page runs it in a web worker, and sends
nothing to a server.
What runs there is the language: variables, strings and their interpolation, if, for,
while, switch, procs, structs and enums, lists and maps, try, defer and with env, and
the packages str, json, toml, csv, table, url, text, rand, whose numbers come
from the browser's crypto.getRandomValues, and time, which tells the time in UTC. echo, a built-in, prints as on a machine, and $(echo ...) captures it.
What needs a machine stops the script at its line: any other program, a pipeline, a redirect,
file., dir., path., re., yaml., sys., keyring., pdf., md., charts,
import, run, wait, spin, time.sleep, with dir and with time.block. The error names
what was reached:
script.ela:1:1: error: not in the browser: running ls needs ela on a machine
The page prints every error as ela prints it at a terminal, followed by its --explain entry:
the rule, why, and a wrong and a right way to write it. ela --explain 'not in the browser'
prints this one's.