Live data from Hacker News

Perl, the first postmodern computer language (1999)

wall.org

61–70 of 225 posts

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

#61

...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…

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 words, there was no standard templating; Template Toolkit eventually became a relatively defacto standard, but PHP had already won - and even then, TT had to be manually invoked rather than just going and freestyling tags everywhere in your HTML and "it just working".

In every other respect Perl is & was superior to PHP, and it's really sad to see Perl fade, despite (or because of?) its crazy flexibility and power.

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

#62
post #21
post #3

Reposting my old comment https://news.ycombinator.com/item?id=10774245 : > People seem to have forgotten that when Perl evolved from being a better AWK to the paradigm example of the modern "scripting language", Larry Wall explicitly described this as a rejection of the Unix small-tools philosophy. http://www.linux-mag.com/id/322/ ("But Perl was actually much more countercultural than you might think. It was intended…

Having dealt with the clunky record structures of 60s operating systems, they did have their advantages, but the spread of cross-platform tools in the 80s and 90s killed them since Unix only knew byte streams. There are, I think some vestiges of it in the distinction between text and binary files on Windows (assuming that this still exists), but otherwise Unix’s everything is a stream of bytes has won. I kind of miss…

I'd have to look into it, but I think the whole reason for text vs. binary demarcation is the fact that ASCII text (not Unicode, old-school ASCII with valid characters 0x01-0x7F) could be sent over a 7-bit serial interface and binary needed that extra bit so you had to introduce overhead to make sure everything reached the other side. Because you might have had actual 7-bit serial (or less) teletypewriters connected in the 60's.

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

#64
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…

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]`?

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

#65

Earlier quoted context omitted.

Just reading this sentence give me horrors.

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.

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

#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.

(In Python's defense, it has a nice ffi.)

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

#67
Perl is really cursed by the past glory. People still trying to revive Perl against modern fad, for example, Python. Fad are powered by steam of live Eco-systems, which Perl once had, but no longer have. There is no real reason why Perl couldn't succeed where Python does other than the path of history. And there is no real reason to chase history today.

Rather than looking for killer app or adding modern features, such as the effort of Perl 6, now Raku, Perl should shed features and focus on stability (which it is fighting hard to retain), on ubiquity (which it had and are losing ground), and core performance (which it is slowly degrading due to features). I think it should try to get a core set into POSIX standard. The core Perl can be like POSIX shell, while a distribution always can distribute a fancier, but always compatible Perl.

Perl should replace shell scripting, period. If there is any reason shell scripts is still preferred, then that should be the TOP focus for Perl steering council to address.

It really frustrates me to see people today, me included, are still trying to manage basic software engineering in shell scripts. It really amuses me today to listen to pastors on how to write good shell scripts. It really saddens me today to watch efforts of inventing a better shell for scripting.

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

#68
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…

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]`?

The last one produces a helpful error message at script interpretation time. @array[1] is probably also an error, or you're doing something very strange / wrong, and it'll stick out like a sore thumb during code reviews.

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

#69
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…

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 everything else as "uncertain" and default to $.

Otherwise, you would have to declare AoA and AoH differently (ex: my @@AoA; my @%AoH;) and then the interpreter could see @AoA[1] and %AoH[1] as valid but %AoA[1] and @AoH[1] as invalid.

I could see that as potentially having value to know at a glance what you are dealing with, but it might break many things, and casting to a new object with my %aoh_1 = %{ $AoH[1] } makes more sense.

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

#70
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…

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]`?

Raku actually adopted that latter syntax. Although, it’s optional as everything really becomes a reference anyway. So you don’t need the „@“ and „%“ sigils any more.
Post reply on HN