Skip to content

Instantly share code, notes, and snippets.

@nige123
Last active November 27, 2020 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nige123/2b7b384dfe2c6e732ecb1c62b3ce6c52 to your computer and use it in GitHub Desktop.
Save nige123/2b7b384dfe2c6e732ecb1c62b3ce6c52 to your computer and use it in GitHub Desktop.
Perl is dead. Long live Perl and Raku.

Perl is dead. Long live Perl and Raku.

'Perl is dead', is a meme that's just plain wrong. Perl isn't dead. It's just dead to some programmers. Complicated regexes? Sigils? There's more than one way to do it (TMTOWTDI)? Sometimes when programmers encounter Perl in the wild they react with fear. "WTF!?", they cry! But fear needn't be a Perl killer. If you take the time to see past Perl's imperfections and walk the learning curve, there are rich rewards: Perl is an imperfect but pragmatic and expressive language that for 30+ years has helped programmers get the job done.

When Larry Wall designed Raku he fixed most of Perl's imperfections and doubled down on Perl's DNA. Perl values pragmatism, expressivity, and whipupitude and Raku does too! Why stop at sigils ($@%) when you can have twice the fun with twigils ($!, %!, @! etc)?

For some programmers, however, the mere sight of a twigil can induce fear. Like Perl, Raku's expressive power is a double-edged sword - potentially stopping other programmers in their tracks. A Raku programmer's, "DWIM" (do what I mean) can be another programmer's "WAT!?"

Fear-free code that flows

We write programs for two audiences: humans and the computer. It's the humans that should come first. If I can't understand my own code in a week's time, what hope do my colleagues have? Fortunately we can help ourselves, and each other, to have a smooth ride up the Raku learning curve.

Learning Raku is never boring but when did you last encounter a bump while learning Raku? That's a chance for you to help yourself and others. You could leave an empathic comment in your code, contribute some documentation, write a blog post, give a talk, ask and answer a question on StackOverflow etc.

The joy of programming is finding flow for ourselves and each other while getting things done. No Raku-riffing-rockstars required.

Surfing the learning curve

Maybe you haven't started learning Raku yet? Now is the perfect time to add Raku to your toolbox. Here are some of the learning resources I've found useful and I hope you do too.

Firstly, there is the pithy and concise introduction to Raku that includes instructions on how to install Raku. The Raku interpreter itself is very helpful. If your Raku program contains errors Raku often suggests ways to fix them.

For programmers coming from other language(s), RosettaCode showcases coding solutions in different languages side-by-side. Prepare to be pleasantly surprised by the expressive power of Raku's operators. Raku's expressivity typically results in less lines of code (LLOC).

An idea for your first Raku program is to translate a progam you know well from a different language. Here are some helpful guides for translating from other languages to Raku: Perl, Python, Ruby, Haskell and Javascript.

There's a growing list of books on Raku and a flowchart for choosing one. Here's a selection:

Searching for Raku-related problems will often point to the official documentation at docs.raku.org or Raku answers on StackOverflow.

When you want to learn more about a specific sub-topic or dive into the deeper design philosophy of Raku check out Jonathan Worthington's clear presentations and explanations.

Finally if you're stuck on something, or just want to share in the -Ofun of learning Raku the #raku IRC channel on freenode is friendly and welcoming.

Both Perl and Raku are useful tools in any programmer's toolbox: no fear needed, just keep the code flowing!

Long live Perl and Raku.

Happy Christmas!

@JJ
Copy link

JJ commented Nov 27, 2020

  1. Link some Perl resources. Specially some that say that Perl is not dead. Don't assume reader knows anything at all.
  2. Also link Raku. Again, people land here from search engines, they need not be aware of any context.
  3. Maybe also link to the jargon file (or whatever) explaining DWIM and WAT.
  4. There's an ellipsis between the 2nd and 3rd paragraph that I can't quite follow. "Perl values this and that", ergo... "Coding in Raku feels like programming in Perl"? I can't quite wrap my head around the argument. Perl is not dead, so here's something that it's not quite Perl but please forget programming in Perl... to make it more dead? I kinda get the gist of the argument "Perl is not dead because its spirit lives on in Raku". But the problem is that there's a flip side to that: "Since its spirit lives on in Raku, it might as well be dead". Maybe you'd want to avoid that or clarify that? The article is bound to raise some controversy, so you might as well pre-empt some trolling by laying it out quire clearly.
  5. Maybe a "Wait, there's more" section explaining how to run Perl programs and use its modules from Raku?

@nige123
Copy link
Author

nige123 commented Nov 27, 2020

Thanks JJ - have addressed most of your comments above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment