Simplify Subroutine Signatures

Do you need simple subroutine signatures?

signatures default behavior is simple.

It is simple alias.

# $foo, $bar
sub foo ($foo, $bar) { ... }
sub foo {
  my ($foo, $bar) = @_;
}
# $foo, @bar
sub foo ($foo, @bar) { ... }
sub foo {
  my ($foo, @bar) = @_;
}

Moose Loose Ends Part the Second

Still error day here in the Moose Pen.

As I am a little lazy today and I didn't have time to work on this project last night, there was a Godzilla film festival on last night, it just a quick postette today.

I went though all the Database::Accessor code today and cleaned up at least the format of my die calls.

Looking about at a number of other applications I figure I might as well go with the semi-standard CME or 'Class', 'Method', 'Error' style.

Lets take this first example the Die that one could run into and that is found in the BUILD sub of Database::Accessor when it call out to the '_loadDADClassesFromDir' sub;

opendir( DIR, $path ) or die "Unable to open $path: $!"; 
Not one of my better error messages so I changed it over to;

Everyday ETL With Yertl

I use ETL::Yertl a lot. Despite its present unpolished state, it contains some important, easy-to-use tools that I need to get my work done. For example, this week I got an e-mail from Slaven (a CPAN tester and a tireless reporter of CPAN issues found by testing) saying that some records were missing from one the APIs on CPAN Testers: The fast-matrix had 3300 records for the "forks" distribution version 0.36, but the matrix had only 300 records. The utilities in ETL::Yertl made it easy to find and manipulate the data I needed to diagnose this problem.

Lingua::EN::ABC now has a spelling-only option

My module Lingua::EN::ABC converts between American, British and Canadian types of English. I've added a new "spelling-only" option to the module which makes it not convert words unless they are pronounced the same but spelt differently. So before it was changing "aluminum" and "aluminium" and "burned" and "burnt", it now won't do that if the spelling-only option is on. This is to assist in looking up words in a dictionary which doesn't feature both kinds of spelling.

An example of using the option is here.

Nordic Perl Workshop 2018 Highlights

mojo_logo.png

  • Mojolicious has a new logo. New shirts, stickers, and other swag coming soon.
  • The Nordic Perl Workshop and MojoConf are the same thing. They had to share the #npw2018 tag with National Payroll Week going on at the same time in the UK.
  • I released a preview copy of my secret project to write a Mojo Web Client book in three months to deliver at this conference. I got really, really close. I expect it to be available through PerlSchool at the end of September.
  • Mojolicious 8 adds several things. Even more Promises, Roles, secure user-agents, and many other things I had to adjust in my Mojo Web Client book.
  • Joel Berger gave his Mojolicious Gardening talk about how to go from a Lite app to a full Mojo app. It's a lot less work than you think and you don't have to do it all at once.
  • Joel Berger wants you to write an article for the Mojolicious Advent Calendar (2017 version). Look at the articles already there and send a pull request.
  • Dylan Hardisonn is rewriting Bugzilla in Mojolicious. Bugzilla has a feature that allows people to apply a limited number of votes to issues. Scarcity allows the important issues to float to the top.
  • We had a lively discussion about what syntax edge cases we'd like to go away.
  • Salve Nilsen thinks every Perl programmer should have a Perl sticker on their laptop as a conversation starter.
  • If you hang out at Hackeriet you are expected to drink Club-Mate (informal advertising slug "You'll get used to it", maybe apocryphal)
  • All the tech companies seem to be hiring. Sebastian says SUSE has lots of jobs.
  • Kronberg Satellite Services was a sponsor, but we didn't get any free satellites or telescopes. They were quite generous despite that.

Moose Loose Ends Part the First

Its error day here in the Moose Pen

Well not really error day more like lets have a look at the errors I spit out and attempt to standardize them, but that is too long for a catch title.

First thing to do was have a look at how my Accessor.pm and from a review I see that I only use 'die'. I found it in about 22 spots in the code. The good thing is I don;t have a mixture of croak, die and croak
carp and confess. The bad thing is I wad never very consistent with my die messages;

Most are just simple strings such as

Attempt to use create with no_create flag on!
The \$container Hash-Ref cannot be empty
Some are a little more informative;

Some cute Perl amigurumis

Disclaimer: this looks like an advertisement, but it's not. I just want to spread the word about really cute Perl goodies. I won't get any money from that.

Do you know amigurumi? It's stuffed crocheted creatures.

A few weeks ago, a free software enthousiast, DoomyFlo asked on Mastodon what kind of FLOSS-related stuff she could crochet. I suggested the Perl onion and the camel and the result is awesome!

Here's the onion: amigurumi Perl onion

Here's the camel: amigurumi Perl camel

The amigurumis are hand-made and 100% cute 🙂

You can order those amigurumi on https://www.doomyflocrochet.com/ (here's direct links to the onion and the camel).

Advantage of Reference Count GC

Do you know advantage of Reference Count GC?

Do you believe Generational GC is best GC?

Do you think about GC deeply?

Advantage of Reference Count GC

I write the entry of Reference Count GC.

You can know the advantage of Reference Counst GC clearly.

World Tour of Germany

Thanks to the generous sponsorship of the Frankfurt Perl Mongers, next week I will be doing a lightning tour through Germany.

On Monday September 10th, I'll be kicking off in Frankfurt, talking about functional programming in Perl all day, and in the evening about my latest Perl modules and the epic three-year saga of how they came to be.

On Tuesday 11th, I'll be in Erlangen at Friedrich-Alexander-Universität, speaking about Transparadigm programming.

On Wednesday 12th, I travel to Dresden, where I'll be explaining how to have fun with dead languages.

And on Thursday 13th and Friday 14th, I'll be in Berlin, giving an evening talk (topic yet to be announced) as well as a full day class on the best new features added to Perl in the past decade.

All these events are absolutely free (thanks again to Frankfurt.pm!) and open to anyone interested in Perl, in multiparadigm programming, in necrolinguistics, or just in having a good geeky time.

Worried Moose

Its re-think things day here in the Moose-Pen

It seems I am getting close to finishing off Database::Accessor and Driver::DBI. I have a very complete test suite for both and an extensive practical test suite for Driver::DBI and all three are running at 100% pass. I should be happy.

Well I am not. The practical testing did show me one major API change that I should make.

If one of the main advantages of Database::Accessor is that it can protect the data in your DB from injection attacks and from backdoor queries that can find things out about your Data or even change it.

It is serves to reason that anyone who is going to try and do this sort of malfeasance at the code level really wouldn't bother to use Datadate::Accessor. Given that the calling format for Database::Accessor is;

$da->retrieve($db_connection);

Which edges cases could perl shed to make it easier to parse?

Bjørvika panoramic view

What would happen if we took the edges cases out of the Perl syntax? We were talking about this over lunch at the Nordic Perl Workshop. I wondered what would happen if we could make a grammar that other things that aren't perl could statically parse? This experiment doesn't care about backward compatibility. We end up with a slightly smaller

Part of the problem is that Perl code can run during the compilation and that can change the way that the parser works. What if that could still happen but the syntax would be the same?

The other huge problem is the availability of CPAN. Which features' disappearance would break CPAN beyond the point where people didn't want to use Perl? Not all of CPAN is important, and how hard would it be to fix these edge case syntax items?

Perl Coding Guide line 2018

Perl Coding Guide line 2018.

Do you need the latest standard Perl Coding Guide Line in 2018 in job?

Dose Your project contains many Perl 4 syntax yet?

Age is Perl 5.28. You can try more good wrinting of Perl 5!

Perl Coding Guide line 2018

(This entry is Japanese. Let' use google translation)

If you want to contribute Perl community, you can translate Perl Zemi content to your language (Twitter Direct Message)

introducing Perl6::Math::Matrix (Part 1: Data)

At TPC in Glasgow I held two talks (slides and Video stored or linked on my domain as linked on conference site) about my module Perl6::Math::Matrix. To me the most interesting parts of this talk were musings about how to write a good API in and for Perl 6. And since I already got from the audience a lot of good suggestion(, which are all implemented by now [by the critic or me]), I will write here also a series of posts about this topic and maybe get some inspirations more.

End of the Line Moose

Its Big Boss day here in the Moose-Pen

I was thinking of continuing on with the gum-shoe motif in my post but once it funny twice is dull and three times is just annoying so I will just dive into the real work for today. Looking at the test suite of Driver::DBI and fixing what has broke since I changes up the API all these many days ago.

I ran the full suite and the only one that failed was 't/40_joins.t' and it dies with about 300 lines of of waring and fails. Fortuntely 90% of them where;

Use of uninitialized value in hash element at ./Database/Accessor/Driver/DBI.pm line 325 
so better get that one first to make my debugging a little easier on the eyes; What I traced it back to was this input hash for a static link

Pull Request - Mission Accomplished

According to the Wikipedia, "The Mission Accomplished" speech was a televised address by United States President George W. Bush on the aircraft carrier USS Abraham Lincoln on May 1, 2003.

My journey so far has been very satisfying. I have had some low times in between but I kept it going. To do this for such a long time consistently, you have to have a real motivation. All credit goes to one man, Neil Bowers, whose contributions inspired me to take this challenge. Every time my PR gets accepted and merged, it gives me immense pleasure that I can't describe in words. Not all my PR were technical. I still remember one PR which was simply adding a space to a line in the code to make it presentable on metacpan.org The response from the author was "Such a perfectionist!". I have compiled some very encouraging responses which I will publish soon.

How to install Strawberry Perl

Strawberry Perl is good Perl distribution for Windows user.

Thanks for many contiributions by Strawbery Perl developers!

Lately I write the entry "How to install Strawberry Perl into Windows".

How to install Strawberry Perl into Windows

(Entry is Japanese. Let's use google translation)

If you want to contribute Perl community, you can translate Perl Zemi contents to your language. (kimoto.yuki@gmail.com)

Solving one of the two great unsolved problems in computer science

It's said that there are two great unsolved problems in computer science: naming, cache invalidation, and off-by-one errors.

If you have a text file and you need to point to particular lines of the file, you may be familiar with the off-by-one errors problem. That's where Text::LineNumber by Jurgen Wiegert comes to the rescue. With this module you no longer need to think about calculating line numbers, but can just hand off the work to the module.

Moose vs the API Change Gang

Its not the end of a story but the beginning of one here in the Moose-Pen today.

When we last saw our hero he was deep into the lair of the dreaded API change gang, Fending off invalidated tests cases left right and center until there was only one left!!

The much to be feared! Test case 't/58_parenthes.t'.

The first error was;

not ok 11 - OR added to last gather condition predicate
Now that my API has changed the following test;

Performance Report - August 2018

Belated Happy Independence Day to all my fellow Indian friends.

Last month, August 2018, was really busy for me, personally and professionally. My 9 years old daughter had summer break from school. So lots of action all the time together with the nearly 2 years old twins. Best part of August was attending The Perl Conference in Glasgow with the entire family. My first Perl Conference ever and it didn't disappoint me. We, as a family, got to explore the city of Glasgow and Edinburgh. Already looking forward to the next one at Riga. There was another highlight last month was that I completed one year of daily CPAN uploads and went past Barbie's record of 370 days. As of today, 1st September 2018, I have completed 377 days.

Lets get into details as below:

  • Pull Request
  • Git Commits
  • Pull Request Challenge
  • Perl Blog
  • PerlWeekly Newsletter
  • Adopt CPAN Module

Pull Request

Last month, I submitted 51 PR as compared to 41 PR in the month of July 2018.

Language::SIMPLE - The Portable Integrated Scripting System

Introducing SIMPLE

SIMPLE is an experimental attempt to integrate end user scripting into Perl applications. It actually stands for Simple Integrated Modular Programming Language Experiment. The idea is that an application one develops might allow an end-user to run scripts they have made, in a custom language targeting the application's operations. Sounds silly? A script parsing utility written in another scripting language? I do a lot of silly stuff.

Some time ago, IpiGears1.jpg attempted to use a Raspberry pi for robotic and other IO applications. To save time and allow for flexibility, I had developed piGears, a scripting tool that could handle the GPIO and also have some basic flow control as well as support for I2C devices. It had been useful for my experiments with electronics, but was a rather niche utility.

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.