YAML::PP Grant Report October 2017

See also my previous report on news.perlfoundation.org and blogs.perl.org.

In October, I have worked over 50 hours on YAML related stuff. Read on...

Configure at the 2017 Perl 5 Core Hackathon

Configure at the Perl 5 Core Hackathon

One major focus of discussion at the Perl 5 Core Hackathon in Amsterdam last month was the status of the program Configure. In this post, we provide a brief introduction to Configure and then discuss the work done on it at the Hackathon and in the subsequent weeks.

What Does Configure Do?

In order to build and install an executable program on a machine, the programmer first has to identify characteristics of that machine: the CPU; the operating system; the libraries; and so forth. Where the machine offers the programmer choices -- e.g., which C-compiler do you want to use -- those choices have to be recorded in a way they can be used by the build and installation procedures.

A configuration program is one which performs these tasks. When building a program from source code, the programmer will typically start with something like this:

    $> ./configure --config-option-1 --config-option-2=foo

Perl 5 Porters Mailing List Summary: October 16th - Nov 1st

Hey everyone,

Following is the p5p (Perl 5 Porters) mailing list summary for the past two and a half weeks.


Hacktoberfest 2017 - Report

One of my favourites annual event that I always look forward to is "Hacktoberfest". This was introduced to me by Neil Bowers in the year 2015. Since then I never missed once. It is so fun, if you are looking constantly for any low hanging issues to grab. GitHub has helped me a lot in this. As most of you are aware, Hacktoberfest is an annual event where you are encouraged to submit at least 4 Pull Requests in the month of October against any project hosted by GitHub. There is a free gift as well, who completes the challenge, which is a specially designed T-shirt delivered to your address for free anywhere in the world. You are free to pick any projects you like hosted on GitHub. No points for guessing my choice of projects, CPAN-related distributions. In my first year 2015, I submitted 45 Pull Requests and received my free T-shirt. The following year 2016, I submitted 12 Pull Requests in the month of October and received my second consecutive free T-shirt. Here comes the year 2017, I just finished the challenge and submitted 40 Pull Requests and waiting for the newly designed T-shirt. I wear them proudly in office every now and then on Friday as the dress code is relaxed on the day. Looking forward to my next year challenge.

LPW: Too much of a good thing can be wonderful!

Last Friday was the deadline for submissons for the London Perl Workshop, and we had originally planned to let all submitters know by Monday. But it turned out that quite a few people were saving their submission for Friday, so we're still working on the schedule.

Read on for the gory details.

Rakudo.js update - more test fixes and NativeCalls works a little

Rakudo.js now passes 74.91% of roast test (84% of the subset specified in the grant)
Recently I have been mostly fixing bugs and implementing missing bits and pieces.
For example :i and :m modifiers in regexes now work a lot better and I have added dynamic quantifiers in regexes like a /"foo" ** {rand.round}/

I have also played around with implementing stuff that's needed for NativeCall (two of the test for passing simple values back and forth work).

I plan to continue working on fixing up the failing roast tests.

London Perl Workshop: last call for talks - deadline this Friday!

The clocks go back this weekend and the deadline of Friday 27th October for your LPW talk submissions is fast approaching!

As you’ve probably seen from earlier posts, we already have some fantastic speakers and subjects lined up, but there’s room for a few more, so if you have an idea you’ve been musing on, now is the time to tell us about it at londonperlworkshop.org/newtalk

Done is Better Than Perfect. Your proposal doesn’t have to be polished - we are happy to provide guidance and suggestions even if it’s just an idea or an outline. Think MVP (that’s Minimum Viable Proposal ;-), get it in ahead of the weekend and we will help you refine it.

We are looking forward to seeing as many of us as possible sharing our experiences and contributing to our community on Saturday 25th November 2017.

Perl6 should be renamed Perl++

I have been a Perl programmer and advocate for almost 20 years. It has saddened me to see Perl loosing ground among newer generations of programmers to languages such as Python, Ruby, and php. Although those languages have their strong points and interesting features, in my opinion, Perl is still a superior language for most general programming applications for various technical reasons, which I will not go into in this posting. That's the subject of a different religious war.

At the very least, Perl should be holding at least an equal standing in popularity to these other languages.

Rakudo Perl 6 Advent Calendar 2017 Call for Authors

Every year since 2009, the Rakudo Perl 6 community publishes a Rakudo Perl 6 advent calendar, in the form of blog posts on perl6advent.wordpress.com.

To keep up this great tradition, we need 24 blog posts, and volunteers who write them. If you want to contribute a blog post about anything related to Rakudo Perl 6, please add your name (and potentially also a topic already) to the schedule, and if you don't yet have a login on the advent blog, please tell Zoffix or someone on #perl6 IRC chat your email address so that they can send you an invitation.

Rakudo Perl 6 advent blog posts should be finished the day before they are due, and published with midnight (UTC) of the due date as publishing date.

If you have any questions, or want to discuss blog post ideas, please join on the #perl6 IRC channel on irc.freenode.org.

2017 Perl 5 Core Hackathon Held in Amsterdam October 12-15

I was fortunate to be invited to participate in the 2017 Perl 5 Core Hackathon (P5H) held in Amsterdam from Thursday, October 12 to Sunday, October 15. This event brings together contributors to the Perl 5 core development process -- often referred to as the "Perl 5 Porters" (P5P) -- for discussion on the current state and future of the language and for hacking to get us to that future state.

Barcelona Perl & Friends: Saturday 4 Nov 2017

This came into my Inbox just now and looked too good to keep to myself ...

Barcelona Perl & Friends: Saturday 4 Nov 2017


A free one-day conference for Geeks and Friends

The computer industry is becoming a place where you are trapped in the feeling that you're missing out if you're not using last week's "hot thing" commented on Twitter, and that no one will be interested if you're not talking about the last functional programming lanaguage, new framework, etc.

The fact is that innovations and amazing things are going on in lots of our "out of sight" communities. Come to show us what you've done, how you like to work, what is working for you and what is not, without the feeling that you'll be frowned upon because you say jQuery, SQL Server, Ruby or Windows.

We're the Perl Community. We want to share with you our ideas and innovations, and want to see yours, no matter what technology you use, what gender you are or where you're from.

Not Just Perl - London Perl Workshop 25th November

As you'd hope, the London Perl Workshop on Nov 25th will feature lots and lots and lots of Perl. But there's also a chance to escape the echo chamber!

I want to break free!

  • Former leader of the London Perl Mongers Sue Spence will dive into "Spiders, Gophers & Butterflies", looking at how a concurrent web crawler compares written in Go and in Perl 6
  • Colin Newell tells us "Why learning a bit of Crypto is good for you", and looks at common security mistakes made by developers who don't know a basic smattering of crypto.
  • Steven Goodwin show us (tongue in cheek) paradigms from the 16 languages he's worked with professionally which Perl developers may not be familiar with in "Ada 99 - Rewriting the very first computer program".

As a bonus, Dave Cross will be showing us exactly how the echo chamber is escaped in his lightning talk of the same name!

Attendance is free, so if you can get to London on the 25th of November, register online now at: http://londonperlworkshop.org

graphql-perl - graphql-js tutorial translation to graphql-perl and Mojolicious::Plugin::GraphQL

Version 0.16 of GraphQL implements most of using the Schema Definition Language to create schemas, rather than doing so programmatically. So let's now translate all the idioms in the JavaScript GraphQL tutorial into Perl!

EDIT version 0.17 implements the rest, so this tutorial translated has been updated slightly as you don't need to specify a schema at all if you call your query type Query, etc.

The format I'll use is to give each of the JS tutorial pages, with the Perl code to do what's given there:

Getting Started With GraphQL.js

You will need Perl 5.14. Consider using perlbrew to get this.

cpanm Mojolicious::Plugin::GraphQL # also gets Mojolicious and GraphQL

Then the first script:

use 5.014;
use GraphQL::Schema;
use GraphQL::Execution 'execute';
use Data::Dumper;
my $schema = GraphQL::Schema->from_doc(<<'EOF');
type Query { helloWorld: String }
say Dumper execute($schema, "{ helloWorld }",
  { helloWorld=>"Hello world!" });

Running an Express GraphQL Server

We'll use Mojolicious::Lite. There's a sample applet on https://github.com/graphql-perl/sample-mojolicious.

Introducing the PAUSE Operating Model

At the Toolchain Summit this year, one of the discussion sessions was to reflect on how the DBIx::Class ownership conflict was handled. We didn't only discuss DBIx::Class, but how a range of other situations were handled. One of the outcomes of that session was a request that the PAUSE admins document the rules and principles for how PAUSE is operated, and how various situations are, or will be going forward, resolved.

Since then the PAUSE admins have been discussing various scenarios and gradually working on a document which we ended up calling the PAUSE Operating Model. The name reflects that it not only describes how PAUSE works, but how the PAUSE admins run the service.

The rest of this post gives an outline of what the document covers, and where you can read it.

Semantic Web/Linked Data

Many of you who have been around computers for as long as I have remember the Semantic Web. It was touted in the late 1990’s and early 2000’s as a way to organise and reason over the Web. This was before the rise of Google and the modern web as we know it today. Mostly, the Semantic Web died because of the problem with Metacrap. However, the idea was resurrected in 2006 as Linked Data. The problem has since been relegated to academia, a few Government projects, like UK’s data.gov.uk, and, interestingly, bio-medical.

Automated testing on Windows with AppVeyor

AppVeyor is a continuous integration service similar to Travis CI, just on Windows. If you have a Perl module on GitHub, it's not that hard to have it run tests automatically on Windows; it's just not well documented.

(The following information was taken from http://blogs.perl.org/users/eserte/2016/04/testing-with-appveyor.html, the AppVeyor documentation, and random trial and error.)

First you need to sign in to AppVeyor with your GitHub account and let it access your repositories, as described on https://www.appveyor.com/docs/.

Then you need to add a .appveyor.yml file to your repository. Mine looks like this:

  - C:\strawberry

  - if not exist "C:\strawberry" choco install strawberryperl -y
  - set PATH=C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH%
  - cpanm --quiet --installdeps --with-develop --notest .

  - perl Makefile.PL
  - gmake

  - gmake test

Cygwin interesting problems

According to this test my module JSON::Parse wasn't working on Cygwin. I have a Windows computer with Cygwin installed, so I thought I would try to compile the module myself. The first problem I encountered was that the cpan shell command didn't work. It would print odd-looking errors and hang up at the following prompt:

What approach do you want?  (Choose 'local::lib', 'sudo' or 'manual')

So I decided to download the module myself with wget and compile it. The next problem was that I hadn't got wget in my cygwin, so I had to install that. After downloading and untarring the file, I tried the usual

perl Makefile.PL

then "make", and got a rather baffling error

fatal error: EXTERN.h: No such file or directory

I was able to find some assistance at this site. It turned out that the C compiler gcc was not included in my cygwin, and the gcc on my path was actually the Strawberry Perl version, so I installed the Cygwin gcc.

Lab::Measurement: New lightweight backends for VXI-11 and USB-TMC

The Lab::Measurement project provides Open Source control of Test & Measurement devices with Perl. This post introduces the new Test & Measurement back end modules Lab::VXI11 and USB::TMC. Both VXI-11 and USBTMC are open standards and are supported by most modern T & M devices. They were developed as alternatives to the legacy GPIB (General Purpose Interface Bus). The main purpose of GPIB is to transfer text messages between the measurement PC and an automated measurement device, such as a digital multimeter. Beyond that, it defines various control commands for device triggering, setting end-of-message characters, reading a status byte and much more. VXI-11 and USBTMC provide a high degree of backwards compatibility with these features.

The photo shows the rear panel of an Agilent 34410A digital multimeter. While it is a small and (relatively) cheap device, it supports four different automation standards (GPIB, USBTMC, VXI-11, raw TCP sockets). This is why I used it for most of my testing.


Don't use until, unless...

In Perl 5, until is a negated version of while. Instead of writing this:

while (defined(my $i = $iter->next())) {
    say $i;

Using until allows you to write this:

until (!defined(my $i = $iter->next())) {
    say $i;

until is documented under the "Compound Statements" heading of the perlsyn document.

Practice and policy

The thoroughly excellent book Perl Best Practices by Damian Conway (DCONWAY), the Black Wizard of Perl, exhorts us not to use the until control structure at all. The core policy set from the similarly excellent Perl::Critic dutifully implements the book's recommendation by raising low-severity warnings if you use it as a block:

until ($foo) {

This yields:

"until" block used at line 1, column 1. See page 97 of PBP. (Severity: 2)

If you use it as a postfix control, an entirely different error arises from transgressing a different edict of Perl Best Practices' holy writ:

bar() until $foo;

This yields:

Postfix control "until" used at line 1, column 7. See pages 96,97 of PBP. (Severity: 2)

Application Metrics with Yertl

A time series database is a massively useful tool for system reporting and monitoring. By storing series of simple values attached to timestamps, an ops team can see how fast their application is processing data, how much traffic they're serving, and how many resources they're consuming. From this data they can determine how well their application is working, track down issues in the system, and plan for future resource needs.

There have been a lot of new databases and tools developed to create, store, and consume time series data, and existing databases are being enhanced to better support time series data.

With the new release of ETL::Yertl, we can easily translate SQL database queries into metrics for monitoring and reporting. I've been using these new features to monitor the CPAN Testers application.

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is hosted by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.