名称§
raku - Rakudo Raku 编译器
概要§
raku [switches] [--] [programfile] [arguments]
说明§
如果没有参数,它将进入 REPL。使用 [programfile]
或 -e
选项,编译给定的程序,并且默认情况下还会执行编译的代码。
- 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 module search path -M module loads the module prior 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=module use Pod::To::[module] to render inline documentation --repl-mode=interactive|non-interactive when 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 and prompts, otherwise a "non-interactive" mode is used where STDIN is read entirely and evaluated as if it were a program, without any extra output (in fact, no REPL machinery is even loaded). This option allows to bypass TTY detection and force one of the REPL modes. --profile[=name] write profile information to a file Extension controls format: .json outputs in JSON .sql outputs in SQL any other extension outputs in HTML --profile-compile[=name] write compile-time profile information to a file Extension controls format: .json outputs in JSON .sql outputs in SQL any other extension outputs in HTML --profile-kind[=name] choose the type of profile to generate instrumented - performance measurements (default) heap - record heap snapshots after every garbage collector run --profile-filename=name provide a different filename for profile. Extension controls format: .json outputs in JSON .sql outputs in SQL any other extension outputs in HTML This option will go away in a future Rakudo release --profile-stage=stage write profile information for the given compilation stage to a file. Use --profile-compile to set name and 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 if enabled in MoarVM)
请注意,只能捆绑布尔单字母选项。
--target
的支持值(阶段)为
Target Backend Description ====== ======= =========== parse all a representation of the parse tree ast all an abstract syntax tree (before optimizations) optimize all an abstract syntax tree (after optimizations) mbc MoarVM MoarVM byte code jar JVM JVM archive
对于 --profile-filename
,指定以 .json
结尾的名称将写入原始 JSON 配置文件转储。如果省略此项,则默认值为 profile-[timestamp].html
。
请查看 环境变量文档,以了解更改 Raku 不同层行为的不同方法。