Skip to content

Latest commit

 

History

History
91 lines (63 loc) · 2.17 KB

18-command-line.md

File metadata and controls

91 lines (63 loc) · 2.17 KB

« Previous: Bytecode and Native Builds · Guide Index · Next: Package Manager »

18. Command-Line Interface

The qs executable is both a language runner and a small toolchain. This chapter lists every command it accepts.


Running programs

qs                          # interactive REPL
qs <file.qs>                # run with the tree-walk interpreter
qs run <file.qs|.qvm>       # run with the bytecode VM
qs vm <file.qs|.qvm>        # run with the bytecode VM (alias)

Building and compiling

qs build <file.qs> [-o out.qvm]   # compile to .qvm bytecode
qs native <file.qs>               # emit native C (a_native.c)
qs compile <file.qs> [output]     # compile to a native binary

See Bytecode and Native Builds.


Developing

qs check <file.qs>      # validate syntax without executing
qs fmt <file.qs>        # format source code
qs lint <file.qs>       # report common mistakes
qs doc <file.qs>        # generate documentation from comments
qs profile <file.qs>    # profile function calls
qs test [directory]     # run *_test.qs files

Projects and packages

qs init                 # scaffold a new project
qs install <url>        # install a package
qs list                 # list installed packages
qs remove <package>     # remove a package
qs home                 # print the QUANTO_HOME directory

See Package Manager.


Information

qs version              # print the version
qs help                 # show usage

Global flags

Flag Effect
--dump-bytecode print compiled bytecode to standard error
--trace print a per-instruction VM trace
--sandbox [path] restrict file access to the given path
qs vm --dump-bytecode program.qs
qs --sandbox ./data script.qs

Next steps

Package Manager covers installing and managing packages.


« Previous: Bytecode and Native Builds · Guide Index · Next: Package Manager »