Perl Love Notes

For a while I have been collecting unattributed and unsolicited positive comments about perl. I think that these are largely applicable to raku, the language formerly known as perl6, also authored by Larry Wall.

Here is my collection:

Python and perl are actually pretty much exactly the same – analogous to the Judean People’s Liberation front versus the People’s Liberation front of Judea. However the languages are optimised for a slightly different purpose. Python helps you to think more like the computer does, whereas perl helps the computer to think more like you do.

Having worked in many languages over many decades, I’ve learned that a high quality codebase is built by high quality developers, largely independent of the languages they use. You can build an unmaintainable mess in any language as easily as you can build a high quality codebase in Perl. I would concede that you can more easily build an unmaintainable mess in Perl than in many languages but that’s up to you; you can do most things more easily in Perl than in many languages 😉

The advantage of bad perl is that it pretty much is immediately obvious on first sight that it’s bad perl. Compare with python, it takes thought and time to identify bad python because it’s so syntacticly bland.

Perl has a weird way of letting you go from thought to code, and disappearing in between, unlike any other language I’ve ever used. You really can go from idea to functioning system as fast as you type without a lot of pre-planning. It’s hard to describe, and the style has fallen out of fashion for more formal, easier to share between humans languages like Java or python, which feel like they introduce an inherent friction in that transition layer as a tradeoff for scalable teams and readability. I miss it, but understand why it fell out of favor. It’s the closest I’ve ever gotten to singing whalesong with a machine.

I so much feel the same. At the time I was writing Perl, each line made so much sense, as if I was speaking my mother tongue. It was clearly an extension of my brain. Never had that feeling with any other programming language, and it took me years to eventually let Perl go and try to wrap my head around Python.

I wonder how much Larry Wall’s background as a linguist has to do with that, which perhaps also explain some of Perl’s “messier” features, just like natural language is kind of messy. I once had a long conversation about this with a linguist and Perl programmer that I randomly met in a pub. However, I was quite drunk and don’t really recall too much, and we never saw each other again.

I use Perl a lot because it doesn’t get in the way. The functional aspect of it lets you map from problem to solution easily.

Stream of consciousness programming?

Perl is one of those languages people love to hate but is, in my opinion, one of the most misunderstood.

Bashing Perl is now a meme, but I can never get over what could have been… Python 3000 and Perl 6 had the community all abuzz. CPAN was the amazing Wild West where people were sharing amazing libraries in such a simple way compared to how every other language was still using the likes of Source Forge and possibly even Fresh Meat (GitHub didn’t exist yet).

Don’t fall into the meme trap of hating on Perl. Although it’s only now used in a handful of companies run by OGs and possibly by devops, I urge you to take a look and spend a month using it – really using it. .. because it really is a beautiful language and it really makes Stream-of-Conscious programming the norm

People have called Perl code line noise. But when I read the book for the first time, everything make sense to me because my mind likes mnemonics. $ is for ($)calar, @ is @(rray), % has a pair of circles like key/value pair and so on.

Perl was one of the first languages I learned and also the first language I used commercially. I have a huge soft spot for it as a language. Still love Perl regular expressions like no other. I loved the camel book and its various footnotes with both humour and deeper knowledge on a topic.

For all of Perl’s shortcomings, I’ve always felt that no other language came with Larry and Randall’s sense that programming was fun. The Perl folks always understood that our skills were rare, and the powers they conferred were inherently magic – even if a bit dorky.

Perl was my first programming language love. While we’ve largely gone our separate ways, we still keep in touch and occasionally we still spend some time together.

I had always wanted to make my own programming language, and then when I saw #rakulang I felt “there’s no way I can make something remotely as awesome as this”. I then gave up, and started writing Raku whenever possible.

I just came back today to Raku after months of Javascript only. God, it feels good. What a fantastic language. The best.

For my part, I continue to use raku as my go to language because I feel this love too.

I feel sad that the world turned its back on perl and raku – sure, 15 years was a long wait for an impatient world and many alternatives beckoned. Its a pity that so many PHP and Python and Javascript and Elm and Rust coders have yet to feel the love and the fun. If you are one, I am quietly hopeful that you will give raku a proper try – enough to get over the shock of using sigils and curlies and to start to hear the whale-song.

~librasteve

Please do feel free to comment and add your own.

2 Comments

  1. markldevine says:

    My experience is near parallel. In the impatient world of language popularity contests, most people only get a shallow view of the landscape. Larry (et. al.) spilled a little magic into Perl and it was measured in flow. Serious flow. But I did grumble about the cruft/warts. Then came Raku and the team spilled the magic dust on that as well — cruft disabled/flow enabled.

    Raku is a batteries-included, artisan toolset. I’m using it for everything (except extreme performance) and its bliss.

    Like

Leave a Comment