Rules / Types, classes & roles / domain-specific

VM Reference

Raku Virtual Machine related information

What it is #

Routines #

Signatures are reproduced from the documentation, including their declared return types. A routine listed here is part of the type's published interface; whether Raku++ implements it is a separate question, answered by the examples below.

method osname #

multi method osname(VM:U:)
multi method osname(VM:D:)

Instance / Class method returning the name of the Operating System, as known by the configuration of the VM object / currently running virtual machine.

method precomp-ext #

Instance method returning a string of the extension that should be used for precompiled files of the VM object.

method precomp-target #

Instance method returning a string of the value of the compilation target that should be used when precompiling source-files with the VM object.

method prefix #

Instance method returning a string of the path in which the virtual machine of the VM object is installed.

method request-garbage-collection #

Available as of the 2020.05 release of the Rakudo compiler. Class method that tells the virtual machine on which Raku is running, to perform a garbage collect run when possible. Issues a warning if such a request is not supported by the virtual machine. Provides no guarantee that the process will actually use less memory after a garbage collect. In fact, calling this method repeatedly, may actually

Examples, run three ways #

Every example below comes from the official documentation, together with the output that documentation asserts. Each was then executed by Rakudo and by Raku++ when this page was built. Where the three agree, one result is shown; where they do not, all three are — because which of them is wrong is exactly the information worth having.

1 no-output

class VM does Systemic { }

Not executed: the documentation states no expected output for this example.