Brian’s Highlights from the DC Baltimore Perl Workshop

The DC Baltimore Perl Workshop took place this past weekend.
It was a one day event followed by a one day hackathon. On Saturday, there were
two tracks, one mainly focused on Perl 5, and the other on Perl 6. On Sunday,
quite a few people stayed for the hackathon which made for an interesting time
with lots of different projects and interesting discussions. I find that workshops
are a great way to have a lot of hands on experiences and one-on-one conversations
that go deeper into issues than is often possible at a conference.

I moved up to the Perl 6 track after that where, after a mini install-fest, Brock Wilcox
led the room in a game of “Randori” – an exercise in which one person
is at a laptop, another one directs the person at the laptop, and the rest
of the room acts as the choir, helping the director tell the programmer
what to do. We did this exercise as a way to learn Perl 6, and the 15 of us
tried to write a program to do word wrapping. It was a lot of fun, and
I think everyone learned something new.

I was sorry to miss David Golden‘s talk about Practical Consistency, though
I was able to talk to him about it at the hackathon on Sunday. He deals
with interesting problems at MongoDB and discussed practical interpretations
of the CAP Theorem. Talking
with him helped me better understand the trade-offs of a distributed storage system
I helped design a while ago (namely that we wanted to guarantee write
availability, which is unusual: most systems have to guarantee read availability).

After lunch Will “Coke” Coleda talked about nativecall and parallelism,
concurrency and asynchrony. He referenced a previous talk
by jnthn on the same topic. He included a great example of using
the race operator to run something
across multiple CPUs in batches. (There is an order-preserving variant called hyper) :

I went down to the Perl 5 track after that where I learned from
Dylan that bugzilla
is quite alive and that there are over 6000 active installations
of it. I spend so much time on github these days that I often forget
that not everyone in the world wants to use a proprietary closed system
for bug tracking.

After Graham talked about how Alien
builds bridges across ecosystems, there were lightening talks. In addition
to the ones above, a memorable one was David Golden’s
smokin’ git rebase which described a technique
for making all commits green when doing a rebase -i. I also
encouraged everyone to try out a game of Rock Paper Scissors,
which was built with websockets and a Perl backend
and a React frontend.

During the hackathon on Sunday I went down a deep Perl 6 rabbit hole. It went like this:

Perl 6 has comments like this that can be attached to the objects proceeding or preceding them:

1
2
3
4
5

classX{#| This is a comment about foohas$.foo;has$.bar;#= This is a comment about bar.}

The Perl 6 metaobject model makes it possible to find these doc strings for attributes.

I had written a documentation server which used these cool features.
Unfortunately, while the first form of comment was working, the second one
was not.

Coke showed me how to clone Perl 6 and run the spec tests and find the unit tests
related to that feature and potentially find the problem in the code.

1
2
3
4
5
6
7

git clone -o github http://github.com/rakudo/rakudo
cd rakudo
perl Configure.pl --gen-moar --backends=moar
make spectest
# This gets the repository http://github.com/perl6/roast# Now to run an individual test, you can do, e.g.
make t/spec/S26-documentation/block-trailing.t

The last step can be done with just perl6 instead of make but then
you won’t skip tests that are flagged as tests to be skipped by rakudo.

Brock had written LREP which allowed me to
drop into a REPL loop (like Ruby’s pry) while Perl 6 code is running.

Combining forces I was able to get together a failing test which showed the problem.

This was kind of amazing, and really drove home one of the design goals of Perl 6 – to
let mere mortals participate in the evolution of the language. Though I haven’t been
able to fix the original problem, at least it seems approachable.