Currently rakudo.js is at the point where:
node rakudo.js -e 'say "Hello World"' doesn't.
The general work-flow for that is:
- Try to compile the setting with rakudo.js.
- While rakudo.js is compiling some error appears.
- I then figure out wheter it's a result of a missing…
Having failed to find a working profiler on npm I ended up webpacking nqp-js-on-js and profiling it directly in Chrome.
I implemented them.
The second big slowdown was actually the slurp() function.
On the nqp-js-on-js due to a misset buffer size slurp turned out sluggish.
While nqp-js-on-js compiles parts of rakudo (with a minor bug fix) it turn out for some reason it's unacceptably slow on some of the larger files (like Perl6::World).
As such I have turned my attention to figuring out what's the problem and speeding nqp-js-on-js up.
Hopefully the next blog posts will be more detailed and contain the description of some nifty optimizations.
I'm considering applying for a TPF grant to allow me to fully focus on working on getting Rakudo to target JS.
To focus the grant application (and pin down the deliverables) I need to choose a use case for rakudo-js to focus on.
Possible ones (ideas for new ones are appreciated).
- running a single page app in a browser (using react.js/jquery or just vanilla js).
- running on top of node.js
- running on top of react.native on a mobile phone
- exploring Perl 6 in your browser (having a awesome REPL, being able to execute snippets etc.)
# save this as hello-world.nqp
my $sc := nqp::createsc('TEST_SC');
my $qast := QAST::Block.new(
my $compunit := QAST::CompUnit.new(
my $compiler := QAST::CompilerJS.new();
Run it like
./nqp-js hello-world.nqp | node