The FScript CLI starts an interactive REPL when you run fscript with no script path and no redirected stdin.
fscriptIf you are running from source:
./src/FScript/bin/Debug/net10.0/fscript>means a new top-level input..means the REPL is waiting for more lines for the current input.
- The REPL tries to parse/evaluate after each entered line.
- If the input is syntactically incomplete, it keeps buffering lines.
- For multiline blocks, submit with an extra blank line after your block (double-Enter while pending).
- On successful execution, expression results are printed.
- If the result is a function value, the REPL prints a typed signature (for example
(x: int) -> int) instead of an opaque closure value.
- Top-level definitions (
let, type declarations, etc.) are retained and available in later inputs. - Pure expression entries are evaluated and printed, but are not retained as top-level declarations unless bound with
let.
- Type and evaluation errors are reported immediately and the pending buffer is reset.
- Parse errors for incomplete input are deferred while you are still typing. If you force submission (double-Enter on pending input), parse errors are reported.
Ctrl+D(EOF) exits the REPL. If there is pending input, the REPL attempts to run it first.Ctrl+Cexits immediately.
Set the sandbox/import root with -r/--root:
fscript -r /path/to/projectThis affects path resolution for import and runtime filesystem extern behavior.
fscript <script.fss>runs file mode.cat script.fss | fscriptruns stdin mode.fscript(no file, no redirected stdin) runs REPL mode.