code

Revisiting Perl in 2023

I went down this particular rabbit-hole as a distraction when I was a little stumped on another project I've been working on.

I wondered: What's going on with Perl these days? It used to be my favorite programming language, and I asked what it would be like to try and pick it back up after almost 20 years. How easy or challenging might it be - what does the ecosystem look like now?

I made a video about it, where I talked a little about the history of Perl and my experiences with it. Then, I revisited the language after 20 years by building a language based on Markov chains to generate text - it's a baby step to building a generative AI model.

If you're worried this might be a video bashing Perl because you're a fan, don't worry: I'm a fan, too. It's an important language, and it continues to be used to do some amazing things - I'm not here to bash it; I'm here to appreciate it.

Some History

When I started college, the teaching language had just switched from Pascal to Java. Java 1.2, to be specific. Other classes were offered in C, C++, Fortran, Visual Basic and I took all of them. However, when I had an opportunity to do an independent study, I made a choice that would open up my mind about what programming could be and how I thought about computing. I decided to do it in Perl. It was my go-to language of choice throughout the rest of college and for the first part of my early career.

What is Perl?

The name stands for practical extraction and report language, and it was invented by Larry Wall in 1987 - it grew in popularity because it's easy to get a lot of things done with it. This is actually a bacronym - or backfitted to fit the name.

The language is built on a flexible design principle with the motto of 'there's more than one way to do it' - it became a mainstay of information technology infrastructure worldwide - powering more scripts, programs and even enterprise-level systems than I can imagine.

Compared to the heavy handedness of Java and C, I found Perl's syntax liberating - it removed much of the unnecessary formality from programming. I found it powerful and flexible, too - you could build anything with it.

I built an open-source desktop environment using just Perl TK - and later a speech recognition command and control application for Linux that gained some popularity among the accessibility community. I gave a talk at Yet Another Perl Conference in 2002 and briefly met Larry Wall, Perl's founder.

I was active in the Perl community - I spent hours upon hours learning and sharing information - it was great to be a part of - but as you can see from my stream on Perl Monk's, my activity and perl usage died off in the early 2000s. I wasn't the only one either.

What happened?

Well, after college, I discovered Python, and my side projects and work projects quickly started shifting over.

There are many reasons that people select specific languages, and Python provided all the essential parts that Perl did without some oddities. So Python became my main go-to for the past 20 years.

What did I build?

I need an objective- what will I build in Perl that can give me a sense of what it's like to work with the language? After some thought, I landed on a text generator based on Markov chains and stochastic models. I've built these in the past for synthetic data generation, so I'm familiar with the approach, and it feels like a natural fit for a Practical Extraction & Reporting Language.

If your interested in the code, I uploaded it to this github repo.

What was my experience in 2023?

I lay it all out in the video, but Perl remains a very powerful language with a vibrant and helpful community 20 years later. I created a fairly effective text generator in less than 200 lines of code. All of the reasons I migrated to Python are still valid today - it fits my mental model better. I recommend people look at it and try it out - it will give you a new way of thinking about the bits you're trying to manipulate.