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
-eexpression goes by in a report. - FAILED π
- The program started and failed: an uncaught raise.
- IO π
- The name
-ebinds theIOcapability 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
knownsources, given as(chunk, shown as, text)and read already, or a moduleβs file. - eval π
- Parse and evaluate
expr, and print the__reprof its value on stdout. - fail π
- Report
messageon stderr under the programβs own name, and hand backstatusformainto 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 unlessIO.Proc.exitalready said otherwise. - is_eval π
- load π
- Read
scriptand 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 ellyexecselly <script> <argsβ¦>: the bare form has to work, withelly run <script>as its explicit spelling. - read_
script π - Canonicalize and read the entry script, or say why not.
- run π
- Load
script, run its__mainagainst a freshIO, and report what happened.