Skip to main content

Crate elly

Crate elly 

Source
Expand description

elly β€” run an Elly module as a program.

A program is a module: the same parser, the same const stage, the same instantiation, plus one reserved moditem saying the file may be run. A library is the same file without it. See docs/done/2026-08-14_elly-run.md.

The runner itself lives in elly-host: the resolver, the IO capability and running __main against it. What is left here is the command line and turning how the run ended into an exit status.

elly -e <expr> evaluates one expression instead and prints its __repr.

StructsΒ§

Script πŸ”’
An entry script, loaded as a module.

EnumsΒ§

Args πŸ”’
What the command line asked for.

ConstantsΒ§

EXPR πŸ”’
The name an -e expression goes by in a report.
FAILED πŸ”’
The program started and failed: an uncaught raise.
IO πŸ”’
The name -e binds the IO capability to.
NOT_STARTED πŸ”’
The program never started: bad usage, an unreadable file, a load or compile failure. The two failure statuses differ because they fail at different stages.
OK πŸ”’
The program ran and asked for nothing else.
USAGE πŸ”’

FunctionsΒ§

describe_load πŸ”’
Why a module graph would not load, in one line.
document πŸ”’
The document a report shows a location in: one of the known sources, given as (chunk, shown as, text) and read already, or a module’s file.
eval πŸ”’
Parse and evaluate expr, and print the __repr of its value on stdout.
fail πŸ”’
Report message on stderr under the program’s own name, and hand back status for main to exit with.
finished πŸ”’
The program returned normally. Its value is ignored β€” printing a result is REPL behaviour, and [] as unit is not distinctive enough to key on β€” so the status is 0 unless IO.Proc.exit already said otherwise.
is_eval πŸ”’
load πŸ”’
Read script and load it as a module β€” with everything it imports β€” in a fresh realm whose relative specs resolve against the script’s directory, or say why not.
main πŸ”’
parse_args πŸ”’
Read the command line. Two invocations, because #!/usr/bin/env elly execs elly <script> <args…>: the bare form has to work, with elly run <script> as its explicit spelling.
read_script πŸ”’
Canonicalize and read the entry script, or say why not.
run πŸ”’
Load script, run its __main against a fresh IO, and report what happened.