News for hackers. Stuff that matters.
Re:Most(ly dead) Influential Programming Languages by tyingq on Thursday March 26, 2020 @06:04AM (#22692058)
Expecting to see Perl in an article like this in 5 to 10 years. Wasn't the first language I learned, but there's a fond place in my heart for it. At the time, it was the (only) less painful way to get at sockets, libc calls like getpwnam(), etc. I know the TIOBE index is flawed, but...ouch: https://www.tiobe.com/tiobe-index/perl/
Re:Most(ly dead) Influential Programming Languages by pjc50 on Thursday March 26, 2020 @08:56AM (#22693041)
Perl is possibly the clearest example of the "Osborne effect": announcing Perl6 took focus off Perl5, but it took far too long to arrive. So by the time it did many of the community had drifted away and the core use cases were becoming less relevant. Python almost did this to itself with the 2to3 transition.
Re:Most(ly dead) Influential Programming Languages by cesarb on Thursday March 26, 2020 @10:20AM (#22693811)
An important difference is that Python 3.0 arrived soon, while it took ages for a complete Perl 6 release to be available. That is, if you didn't want to learn or use Python 2.x because it was soon going to be obsolete, you already had a working alternative; but if you didn't want to learn or use Perl 5.x because it was soon going to be obsolete, for a significant amount of time Perl 6 wasn't an option.
Re:Most(ly dead) Influential Programming Languages by devurand on Thursday March 26, 2020 @12:03PM (#22694937)
> it took ages for a complete Perl 6 release to be available.

And unfortunately, the brilliant minds that worked on Perl 6 spent so much time rewriting the compiler tool chain and basically treating just that part as a research project, that it was incredibly difficult to actually contribute and push the project forward. Couple that with a spec that never seemed finished and a community that tore itself apart because of assholes, and it was a perfect storm to remove Perl from prominence.

Re:Most(ly dead) Influential Programming Languages by goto11 on Thursday March 26, 2020 @07:30AM (#22692476)
But how how influential was it? It seems most of the unique ideas in Perl have not been adopted by other languages.

But if Perl can be credited with kick starting the dynamic language boom (Python, Ruby) then it have been massively influential.

Re:Most(ly dead) Influential Programming Languages by tyingq on Thursday March 26, 2020 @07:32AM (#22692484)
I'd say it was pretty influential for Ruby, CGI-BIN, pcre, and other things that will live on in more refined forms. PHP has some obvious Perl influence as well.

Edit: Maybe also Perl's Configure (crazy wide cross-platform portability) and CPAN. They were pretty ahead of their time.

Re:Most(ly dead) Influential Programming Languages by LeonidasXIV on Thursday March 26, 2020 @09:14AM (#22693213)
While I agree that Perl influenced Ruby which I guess in turn influenced CoffeeScript and Elixir to some degree, the lineage of PHP seems to be dead. I don't really know any languages that are inspired by PHP itself, other than maybe Hack which one could argue is very closely related to PHP.
Re:Most(ly dead) Influential Programming Languages by tyingq on Thursday March 26, 2020 @10:03AM (#22693629)
Even if the lineage dies with PHP, that pulls in Facebook and WordPress.

Smarty could possibly take credit for inspiring some of the template engines out there also.

Re:Most(ly dead) Influential Programming Languages by chipotle_coyote on Thursday March 26, 2020 @02:06PM (#22696199)
I still write and actually still (sorta-kinda) like PHP, but there's no major concept/feature I can think of that's intrinsic to PHP rather than inherited from other languages. The Perl (and general "C-like language" influence is notable, and as PHP has matured it's started to feel ever more like Java. ("To write a simple PHP server app, first just initialize your PSR-11 compatible dependency injection container and add your PSR-7 compatible HTTP request/response handlers to it...")
Re:Most(ly dead) Influential Programming Languages by tyingq on Thursday March 26, 2020 @04:15PM (#22697464)
The mixed code/template capability seems to have led to JSX.
Re:Most(ly dead) Influential Programming Languages by atishay811 on Thursday March 26, 2020 @12:20PM (#22695133)
React(Js framework) is close to PHP as a concept. Facebook's team had to take ideas from their exisitng code. With JSX, we could potentially call it a new language.
Re:Most(ly dead) Influential Programming Languages by nicoburns on Thursday March 26, 2020 @01:31PM (#22695859)
E4X (https://en.wikipedia.org/wiki/ECMAScript_for_XML) is also a likely inspiration for JSX.
Re:Most(ly dead) Influential Programming Languages by jeltz on Thursday March 26, 2020 @11:23AM (#22694425)
CPAN is probably the biggest influence, it is the ancestor of most package managers used today. But Perl has also spread its dialect of regular expression and the idea of regular expression literals, plus it was hugely influential on Ruby which then have lived on in Elixir and Crystal.

Also you may be correct about it kicking off the scripting languages' popularity, and as someone else mentioned it is also responsible for cgibin.

Re:Most(ly dead) Influential Programming Languages by mxyzpt1k on Thursday March 26, 2020 @12:26PM (#22695208)
Perl incorporated regular expressions into a general purpose programming language in a way that seemed fairly unique at the time. Today they seem to be everywhere, often with the help of PCRE-Perl compatible regexps.
Re:Most(ly dead) Influential Programming Languages by Stranger43 on Thursday March 26, 2020 @01:07PM (#22695638)
The problem with perl and this kind of list is that in reality it's just an elegant way of writing awk/sh scripts with proper flow control, i.e. like python today it was seen as an way to get around the compatibility and performance issues associated with shell/awk in the bad old days of commercial Unix.

It might sound strange to modern eyes but there was an time when Perl was considered elegant and robust, but then again very few young people have ever experienced the horrors of trying to write portable shell code for commercial Unix, perl was on the other hand almost completely identical regardless of what variant of Unix you happened to be running, and vastly faster then sh/awk at a time when even expensive systems could be slow by modern standards.

For modern day script writers Ruby and Python have all but replaced perl even though that's not stopping the enterprise from keeping their perl codebases alive and kicking for the foreseeable future, but even there it's being challenged from bellow by the fact that bash and gawk have become fairly universal on Linux systems and hardware fast enough that regex performance rarely matter.

Re:Most(ly dead) Influential Programming Languages by evgen on Thursday March 26, 2020 @02:46PM (#22696575)
In my mind what Perl brought to awk/sh was not flow control but rather data structures that did not make you want to kill yourself. Its standard library also delivered a lot of core sysadmin functionality back in the day and the reporting/output features fit very well with what was needed for early web CGI scripting.
Re:Most(ly dead) Influential Programming Languages by mattkrause on Thursday March 26, 2020 @08:51AM (#22693000)
I'd also give it some credit as a cautionary tale.

A lot of subsequent languages have focused on readability, partly as a reaction to some of the....unique things came up with in Perl.

Re:Most(ly dead) Influential Programming Languages by goto11 on Thursday March 26, 2020 @10:01AM (#22693612)
Yeah, the idea that programming languages should be more like human languages seemed promising at the time. Perl showed us that we definitely does not want that.
Re:Most(ly dead) Influential Programming Languages by tyingq on Thursday March 26, 2020 @10:17AM (#22693773)
Not sure I understand that one. I know Larry Wall is a linguist. But there's not much about Perl, to me, that seems like a human language.

If I dig into the gripes about the syntax, it's usually use of the implied $_ variable, wide use of sigils ($, @, %), derefs of complex data structures (hash of lists of hashes, etc) or regex syntax that people are talking about.

Re:Most(ly dead) Influential Programming Languages by kqr on Thursday March 26, 2020 @04:29PM (#22697639)
That is one of the things that are so brilliant about Perl. Tell a developer to create a programming language inspired by natural languages and you'll get verbose crap like COBOL which superficially looks "natural" but is very far from how languages work.

Perl, on the other hand, looks just like a programming language would if it was the only way we could talk to computers, day in, day out:

- Implicit "it" variable,

- Very brief syntax for common operations,

- More than one way to say things,

- Context determines the meaning of things, and so on.

It's not at all what one instinctively thinks of as "a programming language drawing from natural languages", but on closer inspection (and daily use) that's exactly what such a thing would look like!

Re:Most(ly dead) Influential Programming Languages by lizmat on Thursday March 26, 2020 @05:42PM (#22698294)
FWIW, one of the reasons Perl 6 (now Raku) was started, was to fix the errors made in Perl, to be able to get an even more natural language. Even for difficult things:

  react {
    whenever signal(SIGINT) {
      say "Aborted";
      done;
    }
    whenever Promise.in(3) {
      say "Timed Out"
      done;
    }
  }
  say "Goodbye";
This little program will wait for you to press Control-C or 3 seconds, whichever comes first. And say "Goodbye" on the way out.
Re:Most(ly dead) Influential Programming Languages by goto11 on Friday March 27, 2020 @04:42AM (#22701258)
Yeah, Wall knew what he was doing. He didn't try to make it look like a human language, he tried to make it work more like a human language.

Another significant experiment in Perl was embracing the idea that everybody write in their own personal dialect or subset of the language. Again, the conclusion seem to be that this is a really bad idea since someone else will have to maintain the code eventually. But nevertheless it is valuable that the experiment have been tried. Python took some important lessons from that.

Re:Most(ly dead) Influential Programming Languages by coldpie on Saturday March 28, 2020 @10:34AM (#22711348)
> That is one of the things that are so brilliant about Perl.

> - More than one way to say things

I respect that others may disagree, but I actually find this to be a major disadvantage in a programming language. From a readability perspective[1], having more than one way to express the same task is in my opinion a bad thing. As a trivial example, Perl supports both pre- and post-conditionals:

    if something then x = 1
or

    x = 1 if something
which I find super cumbersome to parse. In all cases, I have to keep the whole phrase in mind before I can understand it, because I don't know which way the phrase will go. If there was only pre-conditionals, or only post-conditionals, then I would know how to parse each part of the phrase before I have read the entire phrase, which makes it easier to parse complex phrases.

I think this is one major reason languages like Perl or C++ are often considered hard to read. Having so many ways to express the same thing means a major mental load until you've figured out what is trying to be expressed.

[1] By now we've all come to agree that easy reading of code is far more important than easy writing of code, right?

Re:Most(ly dead) Influential Programming Languages by kqr on Tuesday March 31, 2020 @01:33AM (#22735150)
Reading code is more important than writing it, but I'm not convinced that two ways to phrase the same conditional assignment is a bad thing. Or, rather, it might not be a bad thing that there are two ways to phrase the same conditional assignment.

See what I did there? Same meaning, different order of clauses. Emphasis ended up on different parts of the sentence! This is a very powerful out-of-band signaling path to control how the reader interprets the literal words, and being used to Perl where we also have it, it is weird to not have it in other languages.

Sometimes the actual predicate is the important/interesting bit, in which case putting it first makes sense: `if (user_is_underaged) return;`. Sometimes the predicate is not as interesting as the expression it's conditioning: `say "message" if debug_mode;`.

Re:Most(ly dead) Influential Programming Languages by b2gills on Tuesday March 31, 2020 @11:57PM (#22745498)
You do realize that comes from english right?

    if $you-are-hungry { make-a-sandwich() }

    make-a-sandwich() if $you-are-hungry;
If you remove all of the non-letter characters, you are left with very understandable english sentences.

    if you are hungry make a sandwich

    make a sandwich if you are hungry
So unless english is a second language to you, it should be fairly easy to understand.

If you pay attention to how people use those different forms in english, you will also notice that the infix form of “if” tends to be used for simple short sentences. Which is exactly how I use it in Perl and Raku.

    sub factorial ( UInt $n ){
      return 1 if $n == 0;
      return 1 if $n == 1;

      return $n * factorial($n - 1)
    }
Though I might consider using `when` instead.

    sub factorial ( UInt $_ ){
      return 1 when 0;
      return 1 when 1;

      return $_ * factorial($_ - 1)
    }
Of course a junction would be useful

    sub factorial ( UInt $_ ){
      return 1 when 0|1;

      return $_ * factorial($_ - 1)
    }
You are probably having fits with that to.

The thing is, that also reads fairly well in english.

    return one when [it is] zero or one
Often times in informal english the “it is” in such a sentence is left off for brevity. So I left it off, because we are obviously talking about “it" (`$_`). I mean, what else could we be talking about? I could easily see this being said as a response to another person.

    > Alice: What result should we give the user?
    >
    > Bob: Return one when zero or one.  
    > Otherwise multiply it by …
You are probably thinking that communicating with a computer should be more formal. You should also be wearing nicely ironed clothes with a jacket and tie.

The problem with that is that you aren't communicating with a computer. You are communicating with everyone that is going to read your code. Reading a technical manual can be very tiring for even the most stoic of readers.

I prefer to read a well written novel. Good Perl and Raku code often reads more like a novel than a technical manual. Even when it is kept very precise about its semantics.

Which means that when I am done doing something in Perl or Raku, I want to continue doing more of that. I don't want to stop.

Sometimes I will find myself re-reading the same line repeatedly at 3am.

---

Further, note how I used the infix form of “if”.

    return 1 if $n == 0;
    return 1 if $n == 1;
The result on the left is very simple. Not only is it simple, it is the same for both lines.

It is very common to use it in this manner. Where they sit at the very beginning of a function as a kind of guard clause. The real important bit is the right part of the lines. Which actually stands out more than the left half, because it is closer to the center of the screen.

After those two lines, we know two things about `$_`. It is neither a `0` or a `1`, because we already dealt with both cases. So we don't have to worry about them in the rest of the function.

For the most part, when I see a line like that I know that I can safely skip over it. That is because it is almost only ever used for that type of thing. As a way to deal with simple cases early in the lifetime of a function. It also means that I can very quickly glean the information I need for that very same reason.

---

People tend to have a lot of bad things to say about Perl and Raku.

Almost everyone who has used them enough to get comfortable with either of the two languages would say just about the opposite to most of those things.

Basically, it's bad in theory, but it's good in practice.

Reminds me of a video “Clay Shirky on Love, Internet Style” https://www.youtube.com/watch?v=Xe1TZaElTAs (9m14s long)

Particularly this line:

> And it was at that moment that I understood what was going on. Because they didn't care.

> They didn't care that they had seen it work in practice, because they already knew it couldn't work in theory.

---

I very much agree that it is far more important to be easy to read. Which is why I find Perl and Raku to be awesome.

I can write things in the most readable way for a person as possible, rather than the only way the compiler can understand.

Re:Most(ly dead) Influential Programming Languages by ryl00 on Thursday March 26, 2020 @10:43AM (#22694006)
> derefs of complex data structures

Am I the only one who finds perl data structures simple and consistent? Once I understood the difference between () and [] (or {} for hashes), it was easy (too easy, some might say!) to construct complex data structures.

Re:Most(ly dead) Influential Programming Languages by devurand on Thursday March 26, 2020 @12:17PM (#22695097)
When I started to learn other languages after learning bash then Perl first, I was really dismayed at how clumsy it was to build up a data structure of any complexity. So verbose in the Java/C++/C# land.

Having those constructs so effortlessly available with a minimal amount of syntax spoiled me. To this day, I would likely still prefer to do any kind of complicated ETL involving deeply nested structures with Perl.

Re:Most(ly dead) Influential Programming Languages by tyingq on Thursday March 26, 2020 @10:47AM (#22694033)
Could partially be the TIMTOWTDI thing. People mixing:

$foo->{bar};

$$foo{bar};

And quoting or not the key, etc. Slices and individual elements, etc. Probably looks like line noise to outsiders when you have a long one using parens to grab a specific array element, combined with $$ and so forth.

Re:Most(ly dead) Influential Programming Languages by WorldMaker on Thursday March 26, 2020 @11:30AM (#22694504)
Plus many years of Bash script intended one-liners to replace or augment awk/sed leading a lot of Perl Golfers to a sublanguage that makes APL look far saner in comparison. That the code golf then shows up in "production scripts" and libraries (if for no other reason than muscle memory) builds a fortress wall to readability by outsiders.
Re:Most(ly dead) Influential Programming Languages by goto11 on Thursday March 26, 2020 @11:05AM (#22694223)
Natural Language Principles in Perl (by Larry Wall): http://www.wall.org/~larry/natural.html
Re:Most(ly dead) Influential Programming Languages by xeeeeeeeeeeenu on Thursday March 26, 2020 @11:14AM (#22694315)
>But how how influential was it?

Raku (formerly known as "Perl 6"), PHP, Ruby and PowerShell were directly influenced by Perl.

Re:Most(ly dead) Influential Programming Languages by downerending on Thursday March 26, 2020 @06:07PM (#22698478)
I think it would be fair to give Perl that credit. When it was first released, there really wasn't anything else like it. There was sh/csh, awk, sed, but nothing that really showed the path forward as Perl did.

That said, once Python 1.5.2 (or so) hit, Perl was done for. It was simply better, and there was no reasonable way for Perl to recover the lead, or even really coexist. Perl had a lot of momentum and took many years to decline, but that was the tipping point, in my mind.

It remains to be seen whether Python3 will displace Python2. :-)

Re:Most(ly dead) Influential Programming Languages by b2gills on Wednesday April 01, 2020 @12:44AM (#22745772)
You do realize that there are more Perl programmers and more Perl code written today then there was back in '99 when Python 1.5.2 was released.

Sure the percentage has gone down, but the count has gone up.

Re:Most(ly dead) Influential Programming Languages by kqr on Thursday March 26, 2020 @09:16AM (#22693242)
Perl consultants and distributors know that Perl is still widely used duct tape in the industry, and has even seen a slight upturn in popularity recently (although perhaps not as much as some other languages), when a new generation of developers has discovered how useful it can be. It's just not something one talks about.
Re:Most(ly dead) Influential Programming Languages by TurboHaskal on Thursday March 26, 2020 @10:00AM (#22693602)
I like Perl a lot, it is the language I have used the most in my professional career. That being said, on my last two workplaces it happened to be in the list of forbidden technologies, not even being able to write a simple one liner and instead having to resort to using awk, sed and the like. It sadly suffers from underserved hate from developers who never used it.
Re:Most(ly dead) Influential Programming Languages by carapace on Thursday March 26, 2020 @10:45AM (#22694020)
s/underserved/undeserved/ eh? (I don't mean to criticize, I've just been noticing a lot of malapropisms recently. I suspect some auto-correct is goofing up.)

Anyway...

Somewhat deserved, surely?

Perl is like the Continuum transfunctioner, "Its power is exceeded only by its mystery." ;-)

Re:Most(ly dead) Influential Programming Languages by ralphc on Friday March 27, 2020 @11:25AM (#22703617)
Can you expand on the "forbidden technologies"? What else was on the list, what were the penalties for entering forbidden territory? Could you use it on your own machine for research?
Re:Most(ly dead) Influential Programming Languages by amyjess on Thursday March 26, 2020 @01:22PM (#22695786)
As someone who works at a company where Perl is used as duct tape, we've slowly but surely been ripping it out piece by piece and replacing it with Python (and by "we", I mean "me").

Much of our "duct tape" is unmaintainable code with undocumented aracne regexes everywhere, single-letter variables, and 1990s-era flow control. Nothing you'd find in Modern Perl is in our duct tape. Ultimately, the fastest turnaround on "we need feature X added to Perl script Y" is going to be "rewrite Y in Python, add feature X" because actually extending the Perl code has proven to be a nightmare.

(and as a side note, most of these Perl scripts ran out of cron on various boxen scattered across our network, and as I've been rewriting them I've also been removing them from cron and putting them in our centralized setup that uses Jenkins to run scripts, pulled out of git, inside Docker images on a schedule)

Re:Most(ly dead) Influential Programming Languages by kqr on Thursday March 26, 2020 @04:21PM (#22697556)
It sounds like bad code is your problem, and not Perl. Am I missing something?
Re:Most(ly dead) Influential Programming Languages by gerikson on Friday March 27, 2020 @06:11AM (#22701599)
I'm a Perl fan, and I'll be the first to admit that something about Perl makes it easier to write idiosyncratic code that the writer understands, but the maintainer may not. The almost fanatical adherence to an official idiom one sees in Python is almost wholly lacking in Perl.
Re:Most(ly dead) Influential Programming Languages by gerikson on Thursday March 26, 2020 @09:53AM (#22693542)
Perl was probably culturally influential - scripting glue - but as a language it's almost uniquely eclectic. There are influences from all over, mostly shell and AWK but also from functional languages.
Re:Most(ly dead) Influential Programming Languages by timwaagh on Thursday March 26, 2020 @08:23AM (#22692812)
I have recently started to use it again as a tool for grepping across multiple lines. It's distributed with every Linux. So it will survive. Maybe it's already dead as a programming language though, certainly because Pascal is also considered dead.
Re:Most(ly dead) Influential Programming Languages by PopeDotNinja on Thursday March 26, 2020 @07:16AM (#22692401)
And maybe Ruby in another 10 to 20?