How to run Rakudo, a Raku implementation, and the command line options you can use with it.
raku - Rakudo Raku Compiler
raku [switches] [--] [programfile] [arguments]
With no arguments, it enters a REPL. With a [programfile]
or the -e
option, compiles the given program and by default also executes the compiled code.
- read program source from STDIN or start REPL if a TTY-c check syntax only (runs BEGIN and CHECK blocks)--doc extract documentation and print it as text-e program one line of program, strict is enabled by default-h, --help display this help text-n run program once for each line of input-p same as -n, but also print at the end of lines-I path adds the path to the path-M the to running the program--target=stage specify compilation stage to emit--optimize=level use the given level of optimization (0..3)--rakudo-home=path Override the path of the Rakudo runtime files-o, --output=name specify name of output file-v, --version display version information-V print configuration summary--stagestats display time spent in the compilation stages--ll-exception display a low level backtrace on errors--doc= Pod::To::[module] to render inline documentation--repl-mode=interactive|non-interactivewhen running without "-e" or filename arguments,a REPL is started. By default, if STDIN is a TTY,"interactive" REPL is started that shows extra messages andprompts, otherwise a "non-interactive" mode is used whereSTDIN is read entirely and evaluated as if it were a program,without any extra output (in fact, no REPL machinery is evenloaded). This option allows to bypass TTY detection andforce one of the REPL modes.--profile[=name] write profile information to a fileExtension controls format:.json outputs in JSON.sql outputs in SQLany other extension outputs in HTML--profile-compile[=name]write compile-time profile information to a fileExtension controls format:.json outputs in JSON.sql outputs in SQLany other extension outputs in HTML--profile-kind[=name]choose the type of profile to generateinstrumented - performance measurements (default)heap - record heap snapshots after every garbagecollector run--profile-filename=nameprovide a different filename for profile.Extension controls format:.json outputs in JSON.sql outputs in SQLany other extension outputs in HTMLThis option will go away in a future Rakudo release--profile-stage=stagewrite profile information for the given compilationstage to a file. Use --profile-compile to set nameand format--full-cleanup try to free all memory and exit cleanly--debug-port=port listen for incoming debugger connections--debug-suspend pause execution at the entry point--tracing output a line to stderr on every interpreter instr (only ifenabled in MoarVM)
Note that only Boolean single-letter options may be bundled.
The supported values (stages) for --target
are:
Target Backend Description====== ======= ===========parse all a representation of the parse treeast all an abstract syntax tree (before optimizations)optimize all an abstract syntax tree (after optimizations)mbc MoarVM MoarVM byte codejar JVM JVM archive
For --profile-filename
, specifying a name ending in .json
will write a raw JSON profile dump. The default if this is omitted is profile-I<[timestamp]>.html
.
Please check out the document on environment variables to check for different ways to change the behavior of the different layers of Raku.
Written by the Rakudo contributors, see the CREDITS file.
This manual page was written by Reini Urban, Moritz Lenz and the Rakudo contributors.