1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
//! The `nybl` command-line interface.
//!
//! Subcommands:
//!
//! | command | what it does |
//! |--------------------------|---------------------------------------------|
//! | (no args) | opens the REPL |
//! | `repl` | opens the REPL (explicit) |
//! | `run FILE` | executes `FILE` with the bytecode VM |
//! | `run --novm FILE` | executes `FILE` with the tree-walker |
//! | `compile FILE` | AOT-transpiles and builds a native binary |
//! | `compile --emit-rs FILE` | emits the transpiled Rust source only |
//! | `--help` / `--version` | prints command help or the installed version |
//!
//! The default `run` path goes through the bytecode VM — it's
//! 2–3× faster than the walker on realistic workloads and the
//! semantics are identical. `--novm` is kept as an escape hatch
//! for debugging or when binary size matters.
//!
//! The REPL retains bindings, functions, types, methods, and loaded modules
//! across submissions. It supports multiline input, expression echo, tab
//! completion, persistent history, `:vars`, `:reset`, `:help`, and
//! `:quit`. Non-TTY stdin uses the same submission model for scripted
//! transcripts.
//!
//! `nybl run` and the REPL surface source-aware warnings before execution.
//! Parse and runtime errors retain line/column information, source snippets,
//! hints, and the owning source for failures raised from imported modules.
//!
//! The REPL, VM runner, walker runner, and AOT compiler support the same
//! transactional `ref` parameter semantics. See the
//! [reference-parameters
//! guide](https://nybl-lang.com/docs/functions/reference-parameters/).
//!
//! Full command documentation is available at
//! <https://nybl-lang.com/docs/cli/>.
use ExitCode;
/// Run Nybl code on a thread with the stack RUN-002 documents for this build
/// profile rather than the main thread, whose size is platform-defined (1 MiB
/// on Windows).