Expand description
Script mode for running .seq files directly
Enables .seq files to run directly with shebangs:
#!/usr/bin/env seqc
: main ( -- Int ) "Hello from script!" io.write-line 0 ;Running seqc script.seq arg1 arg2 or ./script.seq (with shebang) will:
- Detect script mode (first arg is a
.seqfile) - Compile with
-O0for fast compilation - Cache compiled binary (keyed by source + include hashes)
- Run cached binary or compile -> cache -> run
- Pass remaining argv to the script
Functionsยง
- compute_
cache_ key - Compute cache key from source + all transitive includes
- get_
cache_ dir - Get cache directory: $XDG_CACHE_HOME/seq/ or ~/.cache/seq/
- run_
script - Run a .seq script (compile if needed, then exec)