CLI Reference

Command-line interface for the Charl compiler

Commands

charl run

charl run <file.ch>

Executes a Charl program file.

Example

charl run hello.ch

Use Cases

  • Execute complete programs
  • Run ML training scripts
  • Test implementations

charl repl

charl repl

Starts an interactive REPL (Read-Eval-Print Loop).

Example Session

$ charl repl
Charl REPL v0.3.0
> let x = 42
> print(x)
42
> let y = tensor([1.0, 2.0, 3.0])
> print(tensor_sum(y))
6.0

Use Cases

  • Quick experimentation
  • Testing tensor operations
  • Learning the language
  • Debugging expressions

charl version

charl version

Displays the Charl version number.

Example Output

charl 0.1.0

charl --help

charl --help

Shows help information about available commands.

File Extensions

Extension Description
.ch Charl source file (recommended)
.charl Alternative extension

Environment Variables

Variable Description
CHARL_DEBUG Enable debug output (set to 1)
CHARL_TRACE Enable trace-level logging (set to 1)

Exit Codes

Code Meaning
0 Success
1 Syntax error
2 Type error
3 Runtime error
4 File not found

Next Steps