Why Perl 6?

Larry Wall (https://en.wikipedia.org/wiki/Larry_Wall) created the Perl programming language around 1987. With what you've seen up to this point, you may be able understand that he essentially cobbled together bash, sed, awk, and grep. He was trying to make a basic Unix systems administration language, and so, like most other Unix languages, it was quite adept at dealing with text. In the mid-1990s, the web was taking off and people were writing CGI (common gateway interface) scripts. Perl was mature enough to be a really good fit for all the text manipulation involved. This was also about the time that bioinformatics was getting started, and most of that is also about dealing with massive quantities of text (e.g., "ACTG").

In 2000, Larry et al. decided to completely revise the language. Much can be said of Perl 5 -- and has -- that it looks like "line noise," that it's incomprehensible even to those who wrote the code, that it's unmaintainable. All this is true! Perl 6 was a completely non-backwards-compatible rewrite of the language. The designers jettisoned all that they thought bad and kept everything they thought good. Whether or not you agree with their decisions, Perl 6 looks to me to be a fine teaching language. Given what you will learn from Perl 6, you will understand "imperative," "declarative," and "functional" programming concepts that you can apply to any future language you teach yourself.

One of the downsides to choosing Perl 6 is that the language is relatively new. Although it has been in development for over 15 years, it was only "officially" release at Christmas 2015 (the long-running joke being that they kept saying it would be done "by Christmas," but they never said which Christmas). So, there are no books and very few examples to draw from on the web. On the other hand, there is a wonderful IRC community on "irc.freenode.net" in the "#perl6" chatroom, and https://docs.perl6.org is pretty comprehensive. Besides, this will build character. Anyway, I'm not trying to make you an expert Perl 6 programmer, just introducing programming concepts with a language that is actually pretty fun to play with.

In the following examples, I will evolve the programs from simpler to more complex to show you how learning higher-order programming techniques actually shorten your code and make it more maintainable. Don't be worried if you don't quite understand the later versions. Just stick with the concepts in the earlier versions and keep reading and playing with the denser functions until you understand them.

With my rationalization complete, let's write some Perl (6)!

results matching ""

    No results matching ""