Rakudo.js Final Grant Update
We have a Dart Pad inspired REPL called 6Pad that allows you to play with Rakudo.js without installing it.
We have a step by step tutorial how to get your code running in Rakudo.js
You can see an example that uses a canvas to draw a spaceship at https://perl6.github.io/6pad/#5a889cc9d6385853af2ff6a3fa165662
For deploying Perl 6 in the browser we have a Parcel plugin parcel-plugin-nqp.
The plugin will be upgraded to Parcel 2 once that has a non-alpha relase (or maybe even sooner).
You can get a prebuilt rakudo.js from npm with a single command
npm install rakudo
I have decided not to upload the rakudo.js tarballs to CPAN (while easily doable if anybody actually want to get it from there it seems nobody would benefit from that as it seems getting it from npm will be just more convenient for everyone).
We pass our chosen subset of roast tests in headless Chrome using puppeteer
We have a repo with a test runner that bundles up the tests using the parcel bundler and passes them to Chrome
A couple of tests don't work due to either being impossible in the browser (due to using file system IO) or rakudo itself having a fair amount of bugs that pop up when precompiling code (in usual runs tests aren't precompiled so they go undetected).
Those bugs are present in rakudo-moar too but because it can't currently precompile scripts only in code used in modules. I plan to devote some time to investigate how to make the roast test suit catch them after this grant.
See blog post (http://blogs.perl.org/users/pawel_murias/2019/04/rakudojs-update---running-tests-in-a-real-chrome.htm) for a more in depth explanation
In total that makes ~61% of total roast tests (the grant was targeting only a subset of the whole roast), which in practice allows the usage of a huge chunk of Perl 6 (with the biggest omission being multi threading and IO things).
This allows us to import js modules as well as call methods and get attributes of JS objects.
In the current form that allows use to use the DOM in the browser or when run in the browser load node.js modules like