Running, Checking, and Compiling
Use check when you want validation, run when you want the broadest current execution path, and compile when you want a native executable for the supported subset.
fscript check
check is the safest first step while you are writing code.
It currently validates:
- lexing and parsing
- name resolution
- typechecking
- effect analysis
- user-module import graphs
Example:
cargo run -p fscript-cli -- check src/main.fsUse this when you want fast feedback without executing effects.
fscript run
run executes an entrypoint through the current shared IR and interpreter path.
Example:
cargo run -p fscript-cli -- run src/main.fsThis is the broadest execution path today and is the best default while the native compiler is still expanding feature parity.
fscript compile
compile emits a native executable:
cargo run -p fscript-cli -- compile src/main.fs ./mainImportant current nuance:
- there is a real native backend slice
- there is also a broader embedded-runner bridge
compiletherefore covers more than the narrowest real-native path, but less than the long-term goal of full parity
Recommended workflow
For day-to-day iteration:
- write or edit a
.fsfile - run
fscript check - run
fscript run - compile only when you need an executable artifact or want to test current compile coverage
Comparison to TypeScript workflows
If you are used to tsc --noEmit, node, and bundlers:
checkis closest totsc --noEmitrunis the closest equivalent to “execute directly”compileis closer to producing a native binary than transpiling to JavaScript
Choosing the right command
Use check when:
- you only want validation
- the program has side effects you do not want to trigger yet
Use run when:
- you want the most complete current execution path
- you are testing behavior rather than binary output
Use compile when:
- you want a standalone executable
- you are explicitly testing compile coverage
- you are comfortable with the current implementation-status caveats
Next step
See the CLI Overview for command-by-command details.