A VM with adaptive optimization and JIT compilation, built for Rakudo
MoarVM (short for Metamodel On A Runtime Virtual Machine) is a runtime built for the 6model object system. It is primarily aimed at running NQP and Rakudo, but should be able to serve as a backend for any compilers built using the NQP compiler toolchain.
Either download it from the MoarVM site or clone it from GitHub:
git clone https://github.com/MoarVM/MoarVM.gitIf you use the automatically generated release tarballs or zip files please note that they don't contain the third party libraries needed to successfully build MoarVM.
Building and installing the VM itself takes just:
perl Configure.pl make install
(Or
nmake/
gmakeon Windows). Currently it is known to build on Windows with MSVC and gcc, and with
gccand
clangon Linux & MacOS X. We're expanding this with time.
Type
perl Configure.pl --helpto see the configure-time options, as well as some descriptions of the make-time options/targets.
After installing MoarVM, you can clone the NQP repository or grab a source tarball and use the Configure.pl script in it like so:
perl Configure.pl --backend=moar --prefix=where_your_moarvm_install_lives
Alternatively, the same Configure.pl script in NQP is able to clone, build and install a copy of MoarVM on its own if you supply the
--gen-moarflag.
Please bear in mind that this will be the prefix to the
/bin,/liband other directories where themoarexecutable and other files are going to be installed, so you'll have to use/usrif you wantmoarto be copied to/usr/bin.
When pointing the
Configure.plscript in rakudo's repository at a
--prefixthat has an
nqp-minstalled in it, it will automatically detect and configure the MoarVM backend. Alternatively,
--backend=moar,jvmcan be used to force it to build the MoarVM and JVM backends, for example. Just like in the NQP
Configure.plscript, you have the option to supply a
--gen-moarflag that will do all the work for you, including creating an
nqp-m.
MoarVM is currently in development. It can run all of the NQP test suite, all of the Rakudo sanity tests, and passes more spectests than any other Rakudo backend.
Unlike the JVM or JS backend of NQP, the MoarVM repo is not integrated into the NQP source repo but instead can be pulled in by running
Configure.pl --gen-moarconfigure script in the NQP repo.
Some key features provided by MoarVM include:
Contributions by pull request are accepted. Commit bits are given to those who contribute quality work. If you are interested in contributing, drop by the
#moarvmchannel on freenode.org.
See the LICENSE file in the root directory for information on the license of the source code in the MoarVM repository.
If MoarVM fails to build, and the error looks something like this:
ld: symbol(s) not found for architecture x86_64
you likely have an incompatible mix of build and bin utils.
While it is common to have toolchains installed from third party repositories in macOS, they aren't all compatible. In the event you run into this issue, please try these steps.
brew unlink binutils
If you want to use a GNU toolchain, and you get an error telling you to see this file, simply supply the
--toolchain=gnuflag and this package will configure and build with a GNU toolchain.
Please note: If you use mixed Xcode and non-Xcode tools, you are likely to run into trouble. As such, this configuration is unsupported.