Skip to main content

CLI

Use raven --help for the built-in reference. The commands:

raven

On its own, launches a REPL:

$ raven
> 2+2
4

raven <source> [args...]

Runs a file – either a .rv source file (compiled and executed in one step) or a previously built .wasm binary. Trailing arguments are passed to the program (see args()).

OptionEffect
--package <name=entry.rv>Register a package by name and entry point (repeatable)
--no-inlineDisable function inlining
--no-memcheckDisable allocation checks
--stripRemove debug metadata from the binary

raven build <source>

Compiles without running:

$ raven build hello.rv # -> hello.wasm
$ raven build hello.rv -o out.wasm # name the output
$ raven build --js hello.rv # -> hello.js + hello.wasm
$ raven build --js --embed hello.rv # single-file JS
OptionEffect
--jsEmit a JS wrapper
--embedEmbed the wasm into the emitted JS
--esbuildesbuild-compatible wasm imports
-o, --output <file>Rename the output file
--timePrint compiler phase timings

--time output looks like:

Load 113.76ms
Definitions 89.35ms
Interpret 119.46ms
Inference 496.77ms
Expansion 228.47ms
Inlining 1.04s
Refcounts 257.79ms
WASM 158.22ms
Total 2.38s

raven fmt [files...]

Formats source files in place, defaulting to the current directory:

$ raven fmt hello.rv
OptionEffect
--checkList files that would be reformatted
--diffPrint the changes that would be made

Both exit non-zero if anything would change, for use in CI.

raven lsp

Starts the language server, used by editor tooling for diagnostics and formatting.

raven version

Prints the version.