2015.16 + 17: A release, NFG and more GLR work

Hello everybody! I’m back after a postless week. Since there was a compiler release in the earlier of the two weeks, I’ll highlight some of the things this compiler release brings and advances and changes made since then.

Sadly, there’s currently a major startup performance regression that has to do with the way we install modules and their files into a database-like format. This will most likely mean there’ll not be a Rakudo Star release this month.


Pragmas (like “use soft” or “no strict” or “use fatal”) now properly work with lexical scoping.

Along with proper scoping of pragmas, “use fatal” now has a proper implementation. What that implies is for example “try 1/0” immediately blowing up rather than appearing to succeed and returning a Failure object.

The third thing I can mention is that -Mstrict now works to make programs passed on the commandline with -e strict. In fact, -M works with all pragmas now.

Performance improvements

One of the first big improvements came from nwc10 going over MoarVM’s serialization format and kicking out a whole bunch of unnecessary 0 bytes all over the place and also making the deserialization step take fewer CPU cycles in general. This leads to noticably smaller .moarvm files, for example, but also slices off a few cpu cycles during startup. We’re still quite a bit away from getting down to 0.01s startup, compilation and execution for an empty program, but it seems we’re getting closer and closer each month.

By not trying to hold the complete output in RAM, MoarVM’s profiler is now able to spit out json blobs so gigantic that not even the profiler data analysis program written in C++ to handle more data will open it. Before that change (many thanks to flussence for this, btw!) MoarVM would very quickly balloon up in its memory usage and get OOM killed.

lizmat built a eager variant of List.pick(*) that’ll give you a shuffled version of a list faster than the lazy variant. However, List.pick and List.pick(*) themselves got 3% and 7% faster. Something else that’s gotten faster thanks to lizmat is the clone method for the cases where no changes are made to the resulting object via named parameters.


On the documentation side, doc.perl6.org received a 857 inserted lines over the two week period covered. Thanks to moritz, ptc, stmuk, skids and jonathanstowe for their contributions! The files that got changed the most were concurrency, control and objects in the language section. If you miss something in the doc repo or the website, feel free to ask on the IRC channel, open an issue or send a pull request for the WANTED file. Of course if you like, you can also send pull requests for changes or additions to the docs directly.

moritz published a blog post about writing docs on his blog that I found interesting.

And then there’s examples.perl6.org which has seen many, many commits from ptc and stmuk. Kudos!

NFG, GLR, other cool bits

I’d write about the NFG things jnthn has implemented, but he already blogged about it on his personal blog and explained a lot, so I’ll just send you over there to read. If you’re running rakudo from the git repository, you’ll have the Str class backed by NFG. If you’re running the latest compiler release, you’ll be able to use .NFG on a Uni object, but NFG isn’t the default yet.

On the GLR side of things, TimToady has been working more on handling things that flatten or stay itemized. It’s hard to turn the changes and discussion into a succint summary, though. One thing that’s gotten noticably more consistent is the sequence operator (“…”). The latest discussion was on how the two forms of looping over an array should be called: One that treats a list as a collection of items and one that causes a list to flatten its inner lists and iterate over the result.

The rotor method of List and Supply now take a list of pairs as their arguments in the format Take-How-Many => Move-How-Many-More. For now, if you supply two integers, you’ll get the old format of Take-How-Many, Step-Back-How-Many [correction: the backwards compatibility mentioned in this sentence only works in the released version]. This makes it more sensible (the previous default value for Step-Back-How-Many was 1, which is sort of unexpected).

psch and hoelzro have both invested time in the REPL. psch made the tr/// operator aware of adverbs, and of course psch has spent more time on the JavaInterop side of rakudo.

You can now assign a finite list to an infinite slice of an array or assign an infinite list into a finite slice of a list, like this:

my @the-list;
@the-list[15..*]  = 1, 0, 1, 0, 1, 0;
@the-list[0..10] = 0, 2 ... *;
say @the-list;
#-> 0 2 4 6 8 10 12 14 16 18 20 (Any) (Any) (Any) (Any) 1 0 1 0 1 0

As for froggs, have a look at this bit of code he made work just today (well, yesterday):

> say (0..0xFFF0).chrs.join('') ~~ m:g/<:NumericValue({+$_ > 0})>+/
「123456789」 「²³」 「¹」 「¼½¾」 「١٢٣٤٥٦٧٨٩」 「۱۲۳۴۵۶۷۸۹」 「߁߂߃߄߅߆߇߈߉」 「१२३४५६७८९」 「১২৩৪৫৬৭৮৯」 「৴৵৶৷৸৹」 「੧੨੩੪੫੬੭੮੯」 「૧૨૩૪૫૬૭૮૯」 「୧୨୩୪୫୬୭୮୯」 「୲୳୴୵୶୷」 「௧௨௩௪௫௬௭௮௯௰௱௲」 「౧౨౩౪౫౬౭౮౯」 「౹౺౻౼౽౾」 「೧೨೩೪೫೬೭೮೯」 「൧൨൩൪൫൬൭൮൯൰൱൲൳൴൵」 「෧෨෩෪෫෬෭෮෯」 「๑๒๓๔๕๖๗๘๙」 「໑໒໓໔໕໖໗໘໙」 「༡༢༣༤༥༦༧༨༩༪༫༬༭༮༯༰༱༲」 「၁၂၃၄၅၆၇၈၉」 「႑႒႓႔႕႖႗႘႙」 「፩፪፫፬፭፮፯፰፱፲፳፴፵፶፷፸፹፺፻፼」 「ᛮᛯᛰ」 「១២៣៤៥៦៧៨៩」 「៱៲៳៴៵៶៷៸៹」 「᠑᠒᠓᠔᠕᠖᠗᠘᠙」 「᥇᥈᥉᥊᥋᥌᥍᥎᥏」 「᧑᧒᧓᧔᧕᧖᧗᧘᧙᧚」 「᪁᪂᪃᪄᪅᪆᪇᪈᪉」 「᪑᪒᪓᪔᪕᪖᪗᪘᪙」 「᭑᭒᭓᭔᭕᭖᭗᭘᭙」 「᮱᮲᮳᮴᮵᮶᮷᮸᮹」 「᱁᱂᱃᱄᱅᱆᱇᱈᱉」 「᱑᱒᱓᱔᱕᱖᱗᱘᱙」 「⁴⁵⁶⁷⁸⁹」 「₁₂₃₄₅₆₇₈₉」 「⅐⅑⅒⅓⅔⅕⅖⅗⅘⅙⅚⅛⅜⅝⅞⅟ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫⅬⅭⅮⅯⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹⅺⅻⅼⅽⅾⅿↀↁↂ」 「ↅↆↇↈ」 「①②③④⑤⑥⑦⑧⑨⑩⑪⑫⑬⑭⑮⑯⑰⑱⑲⑳⑴⑵⑶⑷⑸⑹⑺⑻⑼⑽⑾⑿⒀⒁⒂⒃⒄⒅⒆⒇⒈⒉⒊⒋⒌⒍⒎⒏⒐⒑⒒⒓⒔⒕⒖⒗⒘⒙⒚⒛」 「⓫⓬⓭⓮⓯⓰⓱⓲⓳⓴⓵⓶⓷⓸⓹⓺⓻⓼⓽⓾」 「❶❷❸❹❺❻❼❽❾❿➀➁➂➃➄➅➆➇➈➉➊➋➌➍➎➏➐➑➒➓」 「⳽」 「〡〢〣〤〥〦〧〨〩」 「〸〹〺」 「㆒㆓㆔㆕」 「㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩」 「㉈㉉㉊㉋㉌㉍㉎㉏」 「㉑㉒㉓㉔㉕㉖㉗㉘㉙㉚㉛㉜㉝㉞㉟」 「㊀㊁㊂㊃㊄㊅㊆㊇㊈㊉」 「㊱㊲㊳㊴㊵㊶㊷㊸㊹㊺㊻㊼㊽㊾㊿」 「㐅」 「㒃」 「㠪」 「㭍」 「一」 「七」 「万」 「三」 「九」 「二」 「五」 「亖」 「亿什」 「仟」 「仨」 「伍」 「佰」 「億」 「兆」 「兩」 「八」 「六」 「十」 「千卄卅」 「卌」 「叁参參叄」 「四」 「壱」 「壹」 「幺」 「廾廿」 「弌弍弎」 「弐」 「拾」 「捌」 「柒」 「漆」 「玖」 「百」 「肆」 「萬」 「貮」 「貳」 「贰」 「阡」 「陆」 ...

As you can see, you can now match against a character’s unicode property value inside a regex. In this case we’re looking for unicode characters that have a numerical value that’s bigger than 0. Pretty cool, IMO!

On the ecosystem, there’s now a module that lets you write a grammar definition in BNF form and use it just like a Perl6 Grammar (that’s because it actually generates a Perl6 Grammar class for you). It’s made by tadzik and you can have a look at one of its test files here. There’s also a POD parser (for the perl5 variant of POD) by dnmfarell on github and the ecosystem.

The last thing before I finally go to bed will be the release itself. We have masak to thank for the release process itself, but I was very glad to see so many different people work on so many different pieces of the whole. I may only be making this up, but it feels like we’ve gotten more contributors 🙂

Well, at least the weekly is pretty big this time ’round, and I don’t think that’s because it covers twice as much time as usual, and there’s already more cool things to look forward to in the coming week 🙂

So you all have a great week now!


One thought on “2015.16 + 17: A release, NFG and more GLR work

Got something to note?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s