Skip to content
Permalink
Browse files

Document MoarVM specific commandline options

Several perl6 commandline options are specific to MoarVM. Only show
those when running on MoarVM. Add the missing ones. Also add documentation
for PERL6_HOME and NQP_HOME.
  • Loading branch information...
patzim committed Apr 24, 2019
1 parent 235f14c commit 8b9297de3d6e74f85dda2466cb6b0f9e10c3b252
Showing with 47 additions and 21 deletions.
  1. +14 −0 docs/running.pod
  2. +33 −21 src/Perl6/Compiler.nqp
@@ -30,6 +30,12 @@ compiled code.
--profile write profile information as HTML file (MoarVM)
--profile-filename provide a different filename (also allows .json)
--doc=[module] Use Pod::To::[module] to render inline documentation.
--dump dump the bytecode to stdout instead of executing (MoarVM)
--full-cleanup try to free all memory and exit cleanly (MoarVM)
--debug-port=port listen for incoming debugger connections (MoarVM)
--debug-suspend pause execution at the entry point (MoarVM)
--tracing output a line to stderr on every interpreter instr (only
if enabled in MoarVM)

Note that only boolean single-letter options may be bundled.

@@ -139,6 +145,14 @@ C<IO::Spec::Cygwin> inherits this from C<IO::Spec::Unix>.
C<IO::Spec::Win32.path> will read the first defined of either C<%PATH%> or C<%Path%> as a
semicolon-delimited list.

=item C<PERL6_HOME>

Allows to override the Perl 6 installation path. Defaults to C<[perl6_executable_dir]/../share/perl6>.

=item C<NQP_HOME>

Allows to override the NQP installation path. Defaults to C<[perl6_executable_dir]/../share/nqp>.

=back

=head1 AUTHORS
@@ -86,7 +86,37 @@ class Perl6::Compiler is HLL::Compiler {

method usage($name?, :$use-stderr = False) {
my $print-func := $use-stderr ?? &note !! &say; # RT #130760
$print-func(($name ?? $name !! "") ~ q [switches] [--] [programfile] [arguments]
my $compiler := nqp::getcomp("perl6").backend.name;
my $moar-options := '';
if nqp::getcomp("perl6").backend.name eq 'moar' {
$moar-options := q --profile[=kind] write profile information to an HTML file
instrumented - performance measurements (default)
heap - record heap snapshots after every garbage
collector run
--profile-compile[=kind]
write compile-time profile information to an HTML
file
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
--profile-stage=stage
write profile information for the given compilation
stage to an HTML file
--dump dump the bytecode to stdout instead of executing
--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)
;
}
$print-func(($name ?? $name !! "") ~ qq [switches] [--] [programfile] [arguments]
With no arguments, enters a REPL (see --repl-mode option).
With a "[programfile]" or the "-e" option, compiles the given program
@@ -97,7 +127,7 @@ and, by default, also executes the compiled code.
-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
-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
@@ -107,25 +137,6 @@ and, by default, also executes the compiled code.
-V print configuration summary
--stagestats display time spent in the compilation stages
--ll-exception display a low level backtrace on errors
--profile[=kind] write profile information to an HTML file (MoarVM)
instrumented - performance measurements (default)
heap - record heap snapshots after every garbage
collector run
--profile-compile[=kind]
write compile-time profile information to an HTML
file (MoarVM)
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
--profile-stage=stage
write profile information for the given compilation
stage to an HTML file (MoarVM)
--doc=module use Pod::To::[module] to render inline documentation
--repl-mode=interactive|non-interactive
@@ -137,6 +148,7 @@ and, by default, also executes the compiled code.
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.
$moar-options
Note that only boolean single-letter options may be bundled.

0 comments on commit 8b9297d

Please sign in to comment.
You can’t perform that action at this time.