2015.33: The Great List Refactor is picking up lots of steam!

Hello everyone!

It’s timotimo here, bringing you another one of those late weeklies you’ve probably been missing while lizmat was helping me out and delivering posts right on time! ;)

Over the last week, the Great List Refactor (GLR for short, or just “glr” when used for branch names) has been moved from a single gist jnthn has been experimenting in to the actual rakudo repository.

Checking out the “glr” branch of rakudo gives you a rakudo with a whole lot of Post-GLR Semantics already in place. There’s also a branch of roast (our spec test suite) called “glr” that’s already down to only 210 (out of 1047) test files with failures in them. That’s absolutely fantastic!

By visiting the perl6 IRC channel you’ll get the chance to have all code evaluations be evaluated once for pre-GLR rakudo and once for WIP-GLR rakudo (the bots camelia and GLRelia respectively), so you can check out differences between the Pre- and Post-GLR Semantics with ease.

The astonishing pace at which the GLR implementation has been progressing is only possible because so many people chipped in – some more, some less, but everyone’s contributions were worthwhile! After jnthn got the rakudo/glr branch to compiling the core setting completely and allowing everybody to test it and play around. Notably, commits landed from nine, moritz, JimmyZ, lizmat, skids, ugexe, hoelzro, perlpilot, and TimToady.

If you’ven’t been excited for the GLR yet, here’s a little benchmark jnthn ran for the “race” feature as implemented in the old GLR gist.

In the time before writing this post, laben also contributed patches to File::Find, Shell::Command and Panda. This brings Panda really close to being able to install packages again when using the glr branch. Zef, an alternative package manager works with both rakudo/nom and rakudo/glr.

Non-GLR related stuff

On a sleepless plane flight, jnthn implemented the supply block syntax (as well as an additional “react” block syntax) from his “changes and syntactic relief for S17” document in rakudo/nom (not yet merged into rakudo/glr). Here’s a simple example script that re-runs tests “whenever” test code or program code has changed.

In the ecosystem, jonathanstowe added Staticish (automatically and transparently turn a class into a singleton) and Audio::Convert::Samplerate (convert PCM audio data using libsamplerate).

On the documentation side of things, dha added the 5to6 documents he’d been working on for a bit. You can find these documents in the language section of doc.perl6.org. Lizmat documented supply-related methods, smls improved subtitles of type pages, and skids, carbin, stmuk and jonathanstowe added miscellaneous improvements.

Articles

  • brrt did two progress reports on the new JIT: “Inching Closer” and “Tiler Update“.
  • Aaron Baugher posted “Starting to Learn Regexes in Perl 6“, in which a simple playlist format with extra support for volume adjustment, audio track selection etc is parsed and then played back in random order.

Since I’m quite tired right now, I’ll end this week’s post here. See you next time, have a good one, and check out rakudo/glr if you want :)

2015.32 The Onset Of Upheaval

Welcome to yet another Perl 6 Weekly that is on time.

Living in interesting times

Jonathan Worthington has taken the GLR (Great List Refactor) from the drawing board into actual development. The current state of prototype implementation is now being carried over into a rakudo branch “glr” (which does not build yet, as this is written). As Larry Wall put it:

hopefully this will be the most disruptive change between now and Christmas :)

Please note that when this branch is merged, it will most likely break a significant part of the ecosystem in most likely unforeseen ways. On the other hand, after this upheaval, Rakudo Perl 6 will be much faster on single cores, but even more so on multiple core systems. A very early unoptimized benchmark shows that doing a race on a map only adds about 4% overhead on a single core system, whereas using 4 cores results in more than twice as fast execution of the given code. So, “fasten da seatbelz”, it may be a bumpy ride until we get there (within the next weeks).

Index dies, with/orwith/without lives

Last week, the Index type was introduced. This week, it is already gone again. Instead, we now have a more powerful set of features, called “with”. I guess examples speak better than words:

with "foo".index("f") -> $pos {  # $pos is 0 and defined
    say $pos;                    # so this is executed
}

Larry Wall explains it in the design documents. Please note that at the moment of this writing, automatic topicalization does not work yet for scoped with/orwith/without. It does however if you use the statement modifier version:

.say with "foo".index("f");   # 0␤
.say with "foo".index("o");   # 1␤
.say with "foo".index("x");   # nothing said

To facilitate using with to return from a subroutine, you can now also call the return method on anything to return from the surrounding subroutine. This allows you to say:

sub a(Int $x) { .return with 2 * $x } # a(42) returns 84

The Future Of p6doc

smls opened an issue about the Roadmap for our language/docs. If you care about Perl 6 documentation, you should read and/or comment!

Work on Javascript backend restarted

Pawel Murias has started working on the Javascript backend again. More power to him (and the people who would like to help him with that!).

Quote Of The Week

I’m so glad we’re getting rid of refcounting in Perl 6. This is horrible :)

Progress Reports and Blog Posts

Some nice blog posts again this week:

Notable code changes

  • Stefan Seifert added a code method to the CallFrame class, so that you can introspect any CallFrame’s Code object (even the ones that do not have a &?BLOCK or &?ROUTINE defined in their scope)
  • Elizabeth Mattijsen implemented indices, as mentioned by Larry Wall.
    .say for "foooo".indices("oo");  # 1␤3␤
    

    It also allows for overlap using a named parameter:

    .say for "foooo".indices("oo",:overlap);  # 1␤2␤3␤
    
  • Prompted by a discussion about $?FILE, Elizabeth Mattijsen made it impossible to create variables and constants with the ? twigil in userland. So, if you have code like:
    my $?FOO = 42;               # not allowed anymore
    my constant $?BAR = "bar";   # not allowed anymore
    

    it will now be broken. You should never have been able to do that anyway. And since a dynamic constant is an oxymoron, this will also not work:

    my constant $*HUH = "not constant";  # was an NYI before
    

Recent Additions To The Ecosystem

2015.31 Blogging Along

Progress Reports and Blog Posts

This week had some nice progress reports and blog posts again:

Swiss Perl Workshop 2015

The program of the Swiss Perl Workshop 2015 is online. Expect talks by Larry Wall, Jonathan Worthington, Carl Mäsak, vendethiel and John Haltiwanger. And of course a Perl 6 Hackathon! If you can’t make it to the YAPC:Europe, this is an excellent alternative!

Notable code changes

  • &?ROUTINE faster
    Recently, Jonathan Worthington implemented &?ROUTINE, a Routine object describing the current routine / method. This however created a noticeable slowdown in rakudo execution: by making this properly lazy, the runtime cost of &?ROUTINE existing, has been greatly reduced.
  • Lingering P5ism now warns
    If you -use- a module in Perl 5, you need to return a true value at the end to indicate the compilation was successful. In Perl 6, no such thing is needed. However, if you cargo culted the 1; as the last line in a module to Perl 6, it would take that, even though it should technically warn as you were using a value in a sink context. Jonathan Worthington made sure it now does. This may mean that loading modules with this cargo-culted property will now warn on being loaded.
  • Introducing Index
    Elizabeth Mattijsen introduced a new type, namely Index. This is an Int for all practical purposes, except that it is also True for 0 (and False only if undefined). This special value of Int is now returned by index(), rindex(), grep-index(), first-index() and last-index(). This means you can now say:
      if "foo".index("f") -> $pos { say "pos = $pos" } # pos = 0
    without having to write special code when the value returned would be 0. This should prevent the common pitfall in the use of these functions if the needle was found at position 0.
  • Socket.print instead of .send
    Rob Hoelz noted that users may confuse the send method (which is just a Str-friendly wrapper over write) with send(2), which is subtly different from write(2). To avoid this confusion, and open up the possibility of a true send(2) analogue in the future, he deprecated Socket.send and made Socket.print.

Recent additions to the Ecosystem

Not too many this week, but still:

2015.29/30 FastForwarding To The Present

After having gone back a year two weeks ago, this Perl 6 Weekly should bring us back to the present and up to speed.

Blog Posts

The past 2 weeks have seen quite some interesting Perl 6 related blog posts:

2015.07.2 Prague

The past week also saw the monthly compiler release of Rakudo, named “Prague“, a joint effort by Carl Mäsak and Moritz Lenz. It came in at about 350 commits. There is also a new Rakudo Star release (by Moritz Lenz).

Multi-Lingual Pun Of The Week

* cdc veut un racadeau pour Noël.

More Asynchronous Sugar

Jonathan Worthington wrote up his thoughts on more syntactic sugar and improved semantics for asynchronous execution. New goodies:

  • await – more powerful with a dynamic Awaiter
  • serial supply – promises you will never do a concurrent emit/done/quit
  • supply syntax construct – create on-demand supplies more easily
  • whenever – an asynchronous loop construct
  • Channel – should probably be renamed for Concurrent::Queue or some such
  • earliest/more/wait/done to be deprecated

Check it out and comment if you want!

Perl Presence at OSCON 2015

The past week saw OSCON again, for the last time in Portland, OR. Perl’s presence there was unfortunately limited. Community booths were smaller again than the year before, and there were fewer of them and they were hidden at the back of the Expo Hall. In a keynote the lane with community booths was referred to as Diagon Alley. It would therefore seem that OSCON is becoming more and more a muggles-only event. OSCON Europe 2015 is said to have no community booths at all.

Anyways, a Perl 6 introductory tutorial by Damian Conway: Perl 6: – Transparadigm programming 101 saved the day in Portland. It also came with script examples. The other presentation by Damian Conway was: Don’t change languages. Change your language. Here he introduced the very nice Perl 5 module Dios Declarative Inside-Out Syntax, which more or less gives you Perl 6 class syntax in Perl 5. Damian also introduced modules that were more oriented towards Perl 5, such as experimentals and Keyword::Declare. If you’re still using Perl 5, they’re definitely worth looking at.

Culling from the Backlog

Recent additions to the Ecosystem

Two weeks worth of additions gives us:

  • Ini::Storage Read/write ini files and manipulate them in memory (by jaffa4)
  • Audio::Encode::LameMP3 Encode PCM Audio data to MP3 in Perl 6 using a binding to liblame (by Jonathan Stowe)
  • AVRO support (by Adriaan Larmuseau)
  • Log::D logging (by jaffa4)
  • Stream::String Stream into a string or from a string (by jaffa4)
  • Atom::Electron Perl 6 desktop applications using JavaScript, HTML and CSS on top of the Electron platform (by Ahmad M. Zawawi)
  • Data::Selector data selection dsl parser and applicator (by Justin DeVuyst)

Winding down

That’s it for these two weeks again. Hope to be having the next one on time again. Have a lot of -OFun!

2014.28: Title goes here. Fill out under all circumstances!

Hello everyone!

Timo is handling the metaphorical pencil again – that’s why the weekly is so late once again …

Well, let’s just see what last week had in store for us. Here’s a few articles to set the mood:

And here’s a bunch of changes – I’m pretending it’s still monday and I’m leaving out the changes that already happened, so this will cover everything between the 6th and the 13th:

  • skids improved the .assuming method on callables (that you can use to get a partially applied version of an existing sub) to generate proper signatures for the resulting callable.
  • lizmat improved the “splice” method on lists to work a bit better; emptying a list (by using splice without arguments) is now 6x faster, for example, and infinite lists are no longer allowed to be spliced in – they probably caused an infinite loop before.
  • thanks to lizmat and moritz, Set and its many friends can now be subclassed by user code again. There used to be a little hack in place that caused errors when a derived class tried to BUILD.
  • In our documentation, smls documented the “fail” sub – and I almost put in some more things here that have happened between monday and today. oops!
  • in MoarVM, we didn’t care to free strings that were used to build error messages, which would then leak. hoelzro has committed quite a big patch that uses our relatively new “throw exception and free strings” function to prevent leaks.
  • brrt made MoarVM build properly with ASAN again on linux; something I believe broke when FROGGS added the choice between using dyncall and libffi.

And here’s a little list of ecosystem additions:

  • BioInfo by MattOates, a BioInformatics package built to benefit from fresh Perl 6 features.
  • Algorithm::Elo by hoelzro, an implementation of the Elo ranking algorithm
  • Dependency::Sort by jaffa4 for turning directed graphs (of dependencies for example) into a linear form

And that’s already it for this week! But new changes have already started accumulating, so see you again next week!

2015.27 It was HOT

Perl 6 Development Fund – Grant Status Update

Jonathan Worthington has written a Grant Status Update in which he lists his major achievements of the grant work so far. Sadly, as it stands now, the end of that grant work is in sight as funds are running out. You can support the Perl 6 Core Development fund yourself (select Perl 6 Development), or convince someone in your organization to have your organization become a major sponsor!

Mogrification in Progress

Jeffrey Goff has taken Perl::Critic and mogrified that into a Perl 5 to Perl 6 Translator. It is a very interesting work in progress, worthy of checking out!

FatRats divide Better

Solomon Foster blogged about a Fun and Easy Fibonacci Trick. FatRats for The Win!

Intermediate Progress on an Intermediate Representation

Bart Wiegmans takes us down into the rabbit hole that is implementing something very much like DynASM. Since that wasn’t part of the original plan at all, Bart thought it justified an explanation.

Using Xapian with Perl 6

Rob Hoelz made an excellent screencast about how he integrated the (C++) Xapian library using NativeCall. One can only hope for more screencasts to come!

AmsterdamX.pm YouTube Channel

Upasana Shukla has announced a YouTube Channel for presentations made at AmsterdamX meetings. Two presentations are of interest for this reader group:

The Perl 6 Story

The Perl 6 Story is another of Andrew Shitov‘s projects, with a lot of nice interviews. Some of which have been mentioned here before, and some have not. Most notably not mentioned here before, are interviews with Carl Mäsak, Stevan Little and Flávio Glock.

From the Development Front

  • Jonathan Worthington has created the underpinnings to multi-dimensional arrays in MoarVM (which e.g. lets a 3x3x3 int Array exist as a single packed blob in memory). The Perl 6 interface to this functionality should become visible in the coming days.
  • Larry Wall tells us he’s been privately prototyping the new non-flattening list and array semantics to see where the new gotchas will be.
  • Leon Timmermans unbitrotted Tap::Parser and added a synchronous TAP parser as well!
  • Elizabeth Mattijsen added a no worries pragma to surpress those pesky “there could be something wrong here” warnings, mostly intended for programmers migrating from Perl 5. She also added two of these warnings (internally called “worries”) for use of the backslash in a Perl 5 way.

From the 4 week backlog

Recent additions to the Ecosystem

In the future, I would like to show the new additions of the past week to the Perl 6 Ecosystem. Since this is the first time, I’ll list them here since the 1st of June:

Winding Down

That’s it for this record-breaking hot week (at least in this part of the world). Hope everybody will keep their cool in the next one!

2015.26 Half-way through the year

Some exciting blog posts came our way this week:

Blog Posts

Rakudo Star 2015.06

There is a new version of Rakudo Star available. Kudos to Tobias Leich for taking care of this!

London Perl Workshop

The London Perl Workshop 2015 has been announced: it will be held in central London on the 12th of December. Its theme will be “A Perl Christmas(?)“. If you have anything to show of Perl 6, and you want to show it in London, be sure to propose a presentation!

Building a Perl 6 Project with Travis CI

Travis-CI now supports Perl 6 out of the box, check out the documentation. Kudos to Paul Cochrane, Rob Hoelz, Nick Logan and Tony ODell for making this happen!

Remarkable Changes of the Week

Apart from many smaller fixes and improvements, these improvements are of note:

  • Adding “is required” attribute trait (by Will Coleda). So now you don’t have to do the ugly
       has $.foo = die "'foo' must be specified";
    anymore if you want to indicate that the specification of a given attribute is mandatory.
  • Deprecation of pipe($cmd) in favour of shell($cmd,:in,:out,:err) by Tobias Leich, as mentioned in the previous Perl 6 weekly. This allows you to read stdout/stderr from run() and shell() by passing :out and :err, and you can write to its stdin by passing :in. You can also suppress e.g. STDERR from a subprocess by passing :!err.

Catching up on backlog

It looks like I’m now behind 4 weeks of backlog, instead of 3. Hope to find the inspiration to go through them in the next Perl 6 Weekly! Have a good one until then!

2015.23..25 Catching Up Is Hard To Do

The past weeks we’ve had no Perl 6 weekly. Trying to catch up with so many things happening on-line and IRL is quite a lot of work and prone to omissions. Please bear with us while we get things on track again.

Blog Posts

For those of you who missed them, there were some excellent blog posts in the past 3 weeks (in chronological order):

Conferences, Conferences, Conferences

The conference season has really started again. Some Perl 6 related videos from the German Perl Workshop in Dresden:

Some Perl 6 related videos from OSDC.no in Oslo, Norway:

And some Perl 6 related videos from the YAPC::NA in Salt Lake City, Utah:

And some related blog posts:

The GLR Is Spreading Its Wings

Patrick Michaud has started a new version of the List And Iteration Synopsis. If you want to keep abreast with the developments there, please check it out. If you have any comments, let them be heard now rather than later!

Rakudo 2015.06 Was Released

Rob Hoelz made the Salt Lake release happen, which came in at 200+ commits. Since then we have seen about 40 commits for the next release, mostly consisting of bug fixes, performance enhancements and the odd new deprecation.

Busy FROGGS

Tobias Leich has been busy. He made:

  • Rakudo on MoarVM buildable on Windows with gcc/gmake
  • Use run()/shell() as a replacement for pipe()
  • Added libffi support, which should let build MoarVM on all platforms

This should make MoarVM build on all Debian platforms except Hurd.

Unicode-8 Support Is Now In

As of 23 June, Rakudo on MoarVM supports Unicode 8.0, only about a week after its release! Appropriately for the Perl 6 Party, it has a code point for Bottle With Popping Cork!

Covariance And Contravariance

A Fresh Look At An Old Issue

Giuseppe Castagna has written an interesting article about (static) typing for Perl 6:

The target reader of (the first part of) the article is every Perl 6 programmer, which is why all the above is explained by examples of Perl 6 code (no formula, theory, theorem, or property whatsoever) and I tried to do my best to make the article completely self-contained…. The second part of the paper targets language implementers and designers.

I haven’t really gotten around to reading it thoroughly, but I find it very interesting that all examples in this article are using Perl 6! Giuseppe is welcoming comments on the per6-language mailing list.

Winding Down

Perhaps this Perl 6 Weekly was a bit too sparse on events on the #perl6 channel. Trying to catch up with 3 weeks of backlog has become such a daunting task, that I have only scanned the first week of June for interesting bits (so far). If there are any other interesting bits in the backlog in weeks 24/25, I will mention them in the weekly of week 26.

If you happen to be in Karlsruhe this weekend, find me at the GPN15!

Hello, dear esteemed readers!

I’ll be attending the Gulaschprogrammiernacht 15 in Karlsruhe this weekend (starting this Thursday evening already), so if you’re interested to talk about Perl 6 or maybe even write or port a library or something, I’ll gladly give you a portion of my time :)

If you’re in Karlsruhe and are not attending, that’s no problem, as there’s no entrance fee, so you can just teleport on by and see what’s up. You can find out more about the event at http://gulas.ch/.

If you want to meet up, you should be able to reach me on the freenode IRC network on #perl6, which I’ll likely check regularly.

See you there, or maybe not!
– timotimo

2015.22: While async & conc are still a bit crashy, enjoy these unrelated improvements …

Last week’s blog post by masak about the “Send More Money” mathematical puzzle kind of sent me off on a little coding spree. A quick profiling run of the “loops” version of the solution quickly showed that a sizable chunk of the run time was spent inside the implementation of the “next” keyword (well, sub really.).

After just a bit of fiddling around with the implementation of “next” – which had been pessimized some time ago for some reason – together with lizmat, the benchmark went from 22s to 15s, about a 30% improvement. This is not only purely less time spent running, but also less work done GCing.

Not only “next”, but also “redo” and “last” have been improved in the same way.

lizmat also went ahead and added a :as parameter to the categorize method like the classify method already had. This lets you change what the value that came in will end up as in the resulting hash. On top of that, the classify and categorize subs also work with a :into named parameter, which allows you to supply the exact type or instance to put the values into.

hoelzro put on his grammar hacking robe and NQP hat and improved error messages for cases when constructs get opened, but not closed. See bugs #125247 and #125153 on the RT.

Another thing hoelzro made work was the .push method for the Buf class (buffers that contain integers of a fixed size, closely packed together).

And then there’s also an interesting fix where an array of just a single pair in adverb notation would have the parser attempt to parse it as a reduce operation. Here, look:

[+] 1, 2, 3   # reduce operation
[:a]          # an array with a single Pair in it

This used to blow up, but works now.

Something I did was dump more information about logging and guards in the spesh dump log. I also found a bunch of places where creating P6int instances didn’t go through our integer cache that hopes to reduce the number of different incarnations of numbers 0 through 15 (now -1 through 14).

Finally, here’s a nice short blog post from domm about his experience porting a very simple script from perl 5 to Perl 6.

Looking forward to what the next week will bring :) In any case, I hope yours will be fine :)