The past week saw reliable support for .hyper
and .race
arrive, as described in Jonathan Worthington‘s blog post earlier this year. Now some operations can be made about 3x faster with just a few keystrokes. To give an example, these are some ways of obtaining the prime numbers below 100000
:
$ time perl6 -e 'my @primes = ^100000 .grep: *.is-prime'
real 0m26.428s
user 0m26.440s
Where real
is the wallclock time that passed, and user
is the amount of CPU-time that was used. Now, by adding a simple .hyper
:
$ time perl6 -e 'my @primes = ^100000 .hyper.grep: *.is-prime'
real 0m9.288s
user 0m31.354s
We go from 26 to 9 seconds wallclock time, which is almost 3x as fast. And if you’re not interested in the order of the final result, you can use .race
:
$ time perl6 -e 'my @primes = ^100000 .race.grep: *.is-prime'
real 0m8.335s
user 0m32.106s
Which is well over 3x as fast.
A more real-world example is the test-t.pl
test of Text::CSV
. The --hyper
version typically runs for 1.14
seconds, whereas the serial (normal) version runs for 2.57
seconds (timings all made on the quadcore machine that yours truly is using, so YMMV).
To execute code that only needs to be run once in a batch, you can use a once
block:
$ perl6 -e '^100 .hyper.map: { once { say "started with $_" } }'
started with 0
started with 64
Unfortunately, it is not yet possible to use phasers inside hypered/raced blocks, mainly because we still need to figure out when e.g. a LAST
phaser should fire: at the end of a batch? Or after the final call of the final batch?
Casual Contributors Welcome!
Ann Barcomb describes a number of useful strategies for managing what she calls “episodic contributors” in her blog post: “How to manage casual contributors to open source projects. I think we can all learn from this, so recommended reading!
More Perl 6 Videos
The uploads page of TPCiA videos shows some more Rakudo Perl 6 related videos this week:
- Machine Learning in Rakudo Perl 6 by Jeff Goff.
- Parsing with grammars shoot-out by Lars Dieckow.
- 20 years of Perl by brian d foy.
cperl
by Reini Urban.
Also, Rakudo Perl 6 – A Primer by Simon Proctor (from the last London Perl Mongers Technical Meeting). Enjoy!
2017.10 Release Delayed
Some showstoppery issues with Rakudo are delaying the 2017.10 release. As this release will most likely be used for the next Rakudo Star release, and thus will be used longer and more extensively, it was considered better to wait until these issues are dealt with, at least temporarily. So stay tuned!
Other Core Developments
As promised last week, a roundup of other core developments of the past 2 weeks:
- Several issues with quoting in
is-run
on Windows were fixed by Zoffix Znet, allowingmake test
to run cleanly again. - Samantha McVey made
IO::Path.parent
take anInt
to indicate how many levels to go up (default: 1). - David Warring made indexing into
NativeCall
‘sTypedPointer
(akaAT-POS
) at least 4x as fast. - Daniel Green improved the speed with which variables are interpolated in regular expressions (aka the internal
INTERPOLATE
subroutine). - Zoffix Znet fixed
IO::Pipe.close
so that theProc
object is always returned, instead of only by the.close
on the last open handle. He also fixed some issues withPromise.in
, andPromise.at
, and very low values / negative values / values in the past. - Timo Paulssen added
Promise.kept
andPromise.broken
as a quick way to generate a kept or brokenPromise
without needing to callPromise.new
. - Zoffix Znet also fixed precedence issues with the Unicode versions
≤
,≥
, and≠
of the ASCII operators<=
,>=
and!=
. - Elizabeth Mattijsen fixed an issue caused by a mismatch in the layout of the
BUILDPLAN
betweennqp
and Perl 6. She also improved the speed of initialization of native arrays and fixed issues with the handling ofFailure
s by some set operators. - And many, many, many more smaller fixes and improvements, both internally as externally visible. Interested in seeing more? Check the ChangeLog or the latest commits.
Blog Posts
- Install
Spark
cluster withDocker
,Sparrowdo
andCentOS
by Alexey Melezhik. - Perl Infrastructure by Gábor Szabó.
- Perl in Brazil (Interview with Breno G. de Oliveira) by BuiltInPerl.
- Not Just Perl – London Perl Workshop 25th November.
- Larry Wall’s Quest for a 100-Year Programming Language by David Cassel (Hacker News, Reddit comments).
- There Is More Than One Way At The Same Time by Wenzel P. P. Peppmeyer.
Meanwhile on Twitter
- Just Preordered by wolfgang.
hyper
/race
just landed! by Zoffix Znet.- Learning Rakudo Perl 6 at a
golang
Meetup! by Francesc. - Sort images based on location by hstejas.
- Arrays by JJ Merelo.
- Enjoy this wonderfully written review by Avdi Grimm.
:out-buffer
on handles by Zoffix Znet.- Beware!
ratchet
in||
by Zoffix Znet. .match
or.subst
in grammar actions by Zoffix Znet.
Meanwhile on StackOverflow
- How to remove diacritics by Eugene Barsky.
s///
and combined diacritics by Eugene Barsky.- Rakudo Perl 6 transforms combined graphemes? by Eugene Barsky.
- Does Rakudo Perl 6 performance suffer by using rationals for decimal numbers by Ross Attrill.
- Passing data to form grammar rules by Eugene Barsky.
- Regex speed by Eugene Barsky.
- How to make grammar produce more than one match? by Eugene Barsky.
Meanwhile on perl6-users
- Is Haskell the right language for teaching FP. No! by Norman Gaywood.
- Module ecosystem and cpan6 and consistency by Richard Hainsworth.
- Who owns my code? by ToddAndMargo.
- Protecting Intellectual Property for Commercial Code by Mark Devine.
Meanwhile on PerlMonks
- Rakudo Perl 6 discoveries — floating-point by Grimy.
- Small discoveries V,
True
/False
/FileNotFound
by holli. - Small discoveries VI,
die
by holli.
Winding Down
Alas, no recent module information on CPAN just yet. We’ve been all too busy fixing bugs before the 2017.10 release. But you should check out the new MetaCPAN-like search functionality of modules.perl6.org
! And while you all do that, I’ll be preparing for next week’s Perl 6 Weekly. See you then!