Revisit Perl programming after 20 years - using Perl to code a generative language model

preview_player
Показать описание
20 years ago, I started shifting development to Python. In this video, I revisit the Perl programming after 20 years and use it to build a simple generative text model based on Markov chains. I have forgotten many things about Perl, so a Perl guru will note many issues as I'm developing the code. The end product worked remarkably well, and I enjoyed getting reacquainted with Perl and its community.

I'll post a link to the github repo in the comments so you can take a closer look.
Рекомендации по теме
Комментарии
Автор

Perl is still the lead in Regular Expressions. 
I still judge programming languages based on how close their ease of use for regular expressions comes to that of Perl.
So many programs and programming languages depend on the pcre (Perl-compatible regular expressions) library.
The syntax of Perl is based on that of the Unix utilities grep, sed, and awk, just some of the tools Perl was designed to replace.

lorensims
Автор

Welcome back to Perl, we need more people like you!

johnnapiorkowski
Автор

At 06:47: the hash is initialized with the stringification of a newly created empty hash as a key, and undef as a value. It definitely is not making an empty hash.

RandalLSchwartz
Автор

I just finished an internship at AMD, and I inherited a handful of report parsing scripts that I had to maintain and supplement with new creations. Every single one was in Perl, and almost all of my work used the language. So even working on the design of AI accelerators, Perl remains in use

SavvyGamingLink
Автор

Never used perl, but this is very interesting to see as someone who's into LLMs, video production value is also remarkable, great work for real, kudos!

a_tabaza
Автор

Wow, this video brought back so many fond memories. Perl was my secret weapon for normalising data and repetitive task automation. It took little to no time to throw something together that made the C guru's turn green with envy - yes it was slower. Yet it got to the results much faster. Like yourself, I finally succumbed to the python flashy lights. I just blew the dust of some of my 30+ year old perl apps. Took a minute to get them running, but most still function perfectly. Had to look up quite a few short codes 🙂 Love your casual but informative style of video. I get the feeling this channel is going to explode!

alanclaughan
Автор

i am probably a younger user of perl here - i can say that i am very proud to use perl to test code from my college java programming class :) perl syntax feels so similar to shell script with the heredoc and backticks, except i know that every byte i feed into it will get taken care of...

template toolkit is now my favorite templating language and i want to look into how perl sockets & CGI works.... i think python and perl are both beautiful languages, but lately i can't get over how smooth it is to deal with text streams in perl :P (mutable for-loop variable is a dream-come-true!)

niuniujunwashere
Автор

Good job, amazing how much you can do with Perl even without expert knowledge of it.

brtastic
Автор

Markov chain seems to be perfect example for practicing the language of Perl!

gugod
Автор

Perl will always have a special place for me

IrredeemableGhost
Автор

I really enjoyed this video. Keep up the good work :)

Pattelito
Автор

Thanks for the interesting lesson on the Perl 5 programming language

yaroshchenko_coder
Автор

The 'split' function typically takes a regex pattern as its first argument. However, if a string containing only a single space character is used (as shown at 10:24), it emulates the behavior of AWK: any leading whitespace in the expression is removed before splitting occurs, and any contiguous whitespace (not just a single space character) is employed as a separator.

andresgz
Автор

Latest Perl _has_ signatures for subs, anyway. You can avoid the use of @_ and $_ at all.

fplove
Автор

I also came back. I had moved to other languages almost 20 years ago, when the Perl6 story frustrated me. Now that Perl6 is out of the way (Raku), I was curious and checked how Perl5 had evolved over the years. Some release notes and the latest version of Randal's book "Learning Perl" made me think: Yes! That's what I was waiting for.
When it comes to versions, I count the 5 as part of the language's name and don't care if there will be a bulk of changes worth renaming Perl5 to Perl7. It is a highly efficient language and I will continue to use it.
By the way, I think at 6:46 you assign a hash reference to a hash variable. Perhaps the {} should be ().

haf
Автор

Learned Perl recently for one of my courses which has since transitioned to python.
I tend to use it for scripting on windows (instead of batch and whatever powershell uses).
Its pretty good.

heroslippy
Автор

Just for the bookkeeping: Perl nowadays *has* function arguments. The author kept his coding style from the 2000s, so unfortunately this video does not really reflect on what has changed since then, rather it shows, how much he still remembers. Still, great video!

snepmilian
Автор

I think readability is why I prefer Python over many languages. Of course, it is up to the developer to make a readable code.

flyinglack
Автор

Don't forget "Pathologically Eclectic Rubbish Lister" as an acronym for Perl.

jasonchesshir
Автор

Nice. I love Perl and seeing this I get some sort of missing feelings. I enjoyed writing Perl code. However, Raku is my language of choice nowadays. It has all of Perl plus some improvements like concurrency, signatures and a lot of other stuff right from the beginning. I wonder what would you think about Perls successor?

wbiker
welcome to shbcf.ru