Hacker News new | past | comments | ask | show | jobs | submit login

I was there then and I am still here today. Ahah.

Perl was the language best suited for text manipulation because of its early popularization of regular expressions. As such, it was excellent for a lot of tasks in « DevOps », even though that term wasn’t a thing then (everyone carried their own water).

I remember deploying a web forum that was coded in Perl once. I remember having to debug large Perl scripts and that was a nightmare. I remember a time when Python was a new odd thing and the long-bearded hacking elite joked about it.

But, all this will be lost in time, like tears in rain…

Just remember one thing: The mess you make with any language is yours, not the language’s.




> Perl was the language best suited for text manipulation because of its early popularization of regular expressions.

It was awk, grep, sed, and lex that popularized regexpes before. Perl attempted to agressively replace awk and sh, even shipped or still ships the a2p.pl script to perform limited awk-to-Perl code conversion. What Perl brought were Perl-style regexpes with capture groups and back references, which are still not characterized in terms of formal language theory when good decision procedures were the entire point of subsetting lexical analyses from eg context-free languages or other more capable models, which is particularly odd considering Larry Wall is a linguist.


As a linguist, Larry was also acutely aware of the difference between prescriptive rules of grammar vs how language is actually spoken by real people, and in terms of informing Perl he always came down firmly on the side of the latter. And now perl is the gold standard for "regexes" even if they don't encode regular grammars anymore.


RE2 may beg to differ, if you care about performance.

https://github.com/google/re2

Agreed on Larry Wall understanding the difference between linguistics and computer science, languages for humans to use vs languages for computers to use.


I think his linguistics background helped him push the boundaries of what people expected from computer programming languages rather; being able to break out of the PL design mindset is part of what made Perl groundbreaking. If I recall correctly, the syntax and semantics of Perl are intertwined to the point that parsing Perl without also evaluating is provably undecidable. From a purely academic standpoint, that sounds like a nightmare, but it's hard to argue that Perl didn't have a significant impact. Many people can learn all the rules and conventional wisdom in a field, but being able to understand the underlying principles well enough to ignore some of them and produce something of value is much more rare.


> If I recall correctly, the syntax and semantics of Perl are intertwined to the point that parsing Perl without also evaluating is provably undecidable.

Perl code that is syntactically correct only on Fridays: https://news.ycombinator.com/item?id=30359309

(Has to do with how subroutine prototypes change how the code parsed where the subroutine is called)


Not that big of a deal. Lisp has a drastically simpler syntax, but can behave is the same way.

This thing that is different from other languages is having a static lexer and parser, versus having a fynamic one. In Perl you modify it indirectly, and in Lisp you can modify it directly.

The fact that this happens has nothing to do with Perl's syntax complexity, but everything to do with dynamism in parsing.


That's hilarious, somehow I had never seen that one before! I love how it immediately makes it much more visceral how wild things can get without needing to get into the weeds of how programming languages work.


Regexes without capture groups are about 90% less useful. If you do not include backrefrences, you still have a regular language, and a matcher can have a guaranteed reasonable run time.

Thankfully, gawk has capture groups, which makes it a very useful tool, unlike the awk shipped with macOS by default.


"Perl combines the power of sh with the speed of awk and the clarity of sed."


It’s hard to call awk, grep, sed, lex, programming languages, don’t you think? It would be even harder to say they popularized regular expressions, considering their very very limited reach. I agree with the rest.


Awk is a bona fide programming language. It makes line-oriented processing extra easy, but so do Perl and Ruby.

While awk is mostly used for text processing (and general data transforms, e.g. in the Linux kernel build system), it allows for writing arbitrary programs, e.g. first-person shooters: https://github.com/TheMozg/awk-raycaster


awk is definitely a programming language, and I've seen people abuse sed in unsettling ways, but yeah, grep sure isn't. lex at least generates C source code but isn't itself a programming language. But they all definitely made regular expressions a normal programming tool well before perl existed.


It makes me sad that qw«foo bar baz» still doesn't work in perl5.


I have good news!

    #!/usr/bin/env perl
    use v5.36; # Minimum version needed for this
    use utf8;
    use experimental qw/extra_paired_delimiters/;
    
    my @arr = qw«foo bar baz»;
    say $arr[1];




Consider applying for YC's first-ever Fall batch! Applications are open till Aug 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: