Live data from Hacker News

Perl, the first postmodern computer language (1999)

wall.org

81–90 of 225 posts

Re: Perl, the first postmodern computer language (1999)

#81

Earlier quoted context omitted.

hah - "peak idiom" for that was when Mr Marketing and Sales from Hawaii, Guy Kawasaki, said that on stage to a bunch of developers. I heard it. It was because the Marketing and Sales-turned "software leaders" couldn't read a regex.

I write regex all the time and I can't read a regex. It's a powerful tool and that's a very valid complaint about it.

Part of the fun of regex is learning to make sense of what looks like black magic

I imagine asm programmers feel the same way

fwiw I think this world needs less "it's too hard for me" and more "let me roll up my sleeves and dig into this"

Re: Perl, the first postmodern computer language (1999)

#82
post #66
post #59

Perl was the first language I used professionally and I used it almost exclusively for years. I don't understand all the negative comments about its use of sigils, I find them useful and I never got the impression that they made the code less readable but maybe that's because I was never taught the gospel of computer science :) I also appreciate the extended backwards compatibility. I still occasionally run decade-ol…

One thing I like about the sigils is that they make bad ideas hard to type. Want to pass me a hashtable of lambdas that return arrays of alternating functions and regexps? Go ahead. Show me how to invoke it. I'm waitng. Python (which has all of the type safety and expressivity of perl) allows such abominations to hide behind clean looking syntax. Sigils also improve readability. Bad Perl looks like serial port noise.…

> Bad Python looks like good python.

Never used Perl, so I can't really make an honest comparison. I do use Python at work, though, and I can assure you that is FAR from being true.

In fact, I think this is so untrue that I urge you to check out essentially any code written in academia (especially projects involving numeric computation and data science). If you come back and make that same statement with a straight face, I'll eat my hat.

Re: Perl, the first postmodern computer language (1999)

#83

I love Perl. I use almost none of its more esoteric features, and just write "classic procedural" code, mostly using command-line utilities instead of third-party modules for anything I don't want to write myself (mainly cryptography), and I am so fucking happy not having to deal with breaking changes in my language, a rare quality these days. I used a machine with a 9-year-old distro on it for a few months, and all…

Yeah, I agree with you. For fun I built Perl 1 a couple years ago and was amazed at how similar it was to Perl 5. In fact most of the test suite from Perl 1 runs unmodified on Perl 5. The subroutine calling syntax was different (it used `do xxx();` I think) so those tests fail. But unfortunately, some Perl devs in recent years keep thinking that what they need to do is break stuff to "modernize". They keep eyeing goa…

> They keep eyeing goals like turning `strict` on by default

Not unless you declare a version. Old style perl will continue to work as before.

If you declare something like:

    use v5.40;
... then, and only then, you'll get strict/warnings/whatever turned on.

Your 20 year old script can continue to run just fine.

Re: Perl, the first postmodern computer language (1999)

#84
post #66
post #59

Perl was the first language I used professionally and I used it almost exclusively for years. I don't understand all the negative comments about its use of sigils, I find them useful and I never got the impression that they made the code less readable but maybe that's because I was never taught the gospel of computer science :) I also appreciate the extended backwards compatibility. I still occasionally run decade-ol…

One thing I like about the sigils is that they make bad ideas hard to type. Want to pass me a hashtable of lambdas that return arrays of alternating functions and regexps? Go ahead. Show me how to invoke it. I'm waitng. Python (which has all of the type safety and expressivity of perl) allows such abominations to hide behind clean looking syntax. Sigils also improve readability. Bad Perl looks like serial port noise.…

> arrays of alternating functions and regexps

many languages will allow you to succinctly express the concept of "the type of this element is a or b"

e.g. typescript:

https://www.typescriptlang.org/docs/handbook/2/everyday-type...

Rust:

https://doc.rust-lang.org/book/ch06-01-defining-an-enum.html

F# :

https://docs.microsoft.com/en-us/dotnet/fsharp/language-refe...

IDK, allowing that kind of type to be declared seems like a good thing to me? Those links have good examples of where it's useful. You'd need a good reason to use actually "function or regexp" in actual code though.

Re: Perl, the first postmodern computer language (1999)

#85

...to this day, I still can't wrap my head on how PHP even got to exist in a world where Perl was already filling the web niche just fine. Also, if they wouldn't have made it too-weird-for-math-and-physics people, Perl would've probably filled Python's niche too. And with that kind of resources focused on it, Perl 6 could've actually turned up into a clean nice new language that would've unified us all by also suppor…

If we're speaking alternative realities, I'd like to live in the one where Lisp took over instead of Java/C++...

Re: Perl, the first postmodern computer language (1999)

#86

Earlier quoted context omitted.

It's easy; PHP is/was: Whilst the equivalent Perl at the time would be: #!/usr/local/bin/perl print "Content-Type: text/html\r\n\r\n"; print " "; print "Hello world"; print " "; or possibly... #!/usr/local/bin/perl use strict; use warnings; use CGI; my $q = CGI->new; print $q->header('text/html'); print $q->start_html(); print "Hello world"; print $q->end_html(); ...if you were being a bit more more fancy. In other w…

Pretty sure there's a way to load perl as a webserver module like PHP, then you can do that embedded stuff too

Yes, but that stuff came later. It's actually the first way I used Perl on the web, but by then PHP was off to the races.

You could even get modules that would allow you to inline Python just like PHP, although the interaction between that and mandatory indentation could get a bit "interesting".

Also perhaps ironically, this style of mixing code and HTML has generally come to be regarded as an antipattern. PHP may still be able to do that, but woe unto the project that wants to write tons of code that way. But it's still the foothold PHP used to wedge its way into at least the B tier of languages.

Re: Perl, the first postmodern computer language (1999)

#87

For years Mr Wall attempted to justify Perl as the manifestation of 90's neohippie culture, as this mashup of weirdness that was cool because it didn't worry about being particularly consistent with itself. I think the worst of it is when he draws parallels with the Dave Matthews Band. Ugh. Nothing screams "I'm soooo dated" like fixating on short-lived youth trends. Perhaps he should've described Perl as "hip hop" bu…

I take it there are a lot of rabid Dave Matthews fans on here.

Re: Perl, the first postmodern computer language (1999)

#88

Earlier quoted context omitted.

It’s a blessing because once you are comfortable with a Perl dialect, writing code is very efficient and fun. Perl is very expressive and can also be very concise. It’s a curse, because reading other people’s dialects can be quite difficult.

> reading other people’s dialects can be quite difficult. That is why we send any code that cannot be read by a fresh CS grad back for rework. It turns out you can solve everything with very basic and straightforward syntax. But then we also don't use perl.

By the time I was done writing Perl, my Perl looked a lot like Python.

It's also why I'm not really all that sympathetic to "but $NEWLANG doesn't let me write something that extracts from a hash and then map all the elements with an inline anonymous function, filter the results, and then invoke them all and put the results in a single array all in one line!". I worked for decades, plural, in languages that did permit that, and what I learned is that the more professional the code gets, the less you should be doing that. By the time you've broken it out in a way that won't confuse everyone, giving all the intermediate values professional-quality names and adding a few comments, it turns out the delta between Perl and things like Java or Go or other such "stodgy" languages has closed a lot. Not 100%, by any means, but closer, and in the meantime those stodgier languages have been steadily closing the gap from their end too. In the meantime I get a lot of value from the static guarantees those languages have.

Re: Perl, the first postmodern computer language (1999)

#89
post #69

Earlier quoted context omitted.

Here's one reason why sigils could be considered to suck. `@array` - array of values. `$array[1]` - get element 1 of the array. `$array` - What do you think this does? Why can't we just `@array[1]`?

> `$array` - What do you think this does? I think it will throw an error if you declared my @array > Why can't we just `@array[1]`? Because that could return an array or a hash if you are dealing with structures likes arrays-of-arrays (AoA) or arrays-of-hashes (AoH). To my naive take, it makes much more sense to only identify high level objects to put them under one category (arrays, AoA, AoH -> @) then consider ever…

[deleted]

Re: Perl, the first postmodern computer language (1999)

#90
post #69

Earlier quoted context omitted.

Here's one reason why sigils could be considered to suck. `@array` - array of values. `$array[1]` - get element 1 of the array. `$array` - What do you think this does? Why can't we just `@array[1]`?

> `$array` - What do you think this does? I think it will throw an error if you declared my @array > Why can't we just `@array[1]`? Because that could return an array or a hash if you are dealing with structures likes arrays-of-arrays (AoA) or arrays-of-hashes (AoH). To my naive take, it makes much more sense to only identify high level objects to put them under one category (arrays, AoA, AoH -> @) then consider ever…

> Because that could return an array or a hash

@array[1] returns a single-element list-like thing. It mostly works, but you get a warning:

https://perldoc.perl.org/perldiag#Scalar-value-@%25s%5B%25s%...

Post reply on HN