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.

EnumsΒ§

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

ConstantsΒ§

FAILED πŸ”’
The program started and failed: an uncaught raise.
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.
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.
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.