Live data from Hacker News

Perl, the first postmodern computer language (1999)

wall.org

131–140 of 225 posts

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

#131
post #66

Earlier quoted context omitted.

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…

You have misunderstood GP.

Alternating functions and regexps looks like this:

    [\&some_function, qr/some_regex/, \&another_function, qr/another_regex/]
This is distinct from the idea of sum types.

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

#132
post #126

Earlier quoted context omitted.

Well it's your lucky day. Named parameters are perl since 5.20 ... as an "experimental" feature ... Now you can write. use v5.20; use feature 'signatures'; sub print_text( $param1 , $language = "perl", $years = 10 ) { say "I would have loved this $language $param1 more then $years years ago"; } print_text "feature"

This already was available more than ten years ago, you simply had to install a module.

I used to use perl5i for scripting, which had func().

Point is. As soon as I tell someone "you have to use tarball/cpan/cpanplus/cpanminus to install the feature "named parameters" they leave.

But now it's here

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

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

> Why can't we just `@array[1]`?

Because of slices. If you look at the complete table, you will never get confused again.

https://news.ycombinator.com/item?id=26578855

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

#134
post #95

Earlier quoted context omitted.

p.s. This is fun. So what constitutes a Brutalist programming language? It should be something that: - Exposes the construction materials - Implies mass and permanence - Is usually institutional, e.g. libraries, government buildings, public housing. Only rarely shopping centres or company head offices (which were usually done in the "International" style when Brutalism was a thing). What fits that bill? How about SQL…

C++ is absolutely the world's foremost brutalist language.

What? Not even close. C++ is Baroque.

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

#135
post #122

Earlier quoted context omitted.

It's actually a bit more than that. In "Windows Powershell in Action", Bruce Payette (one of the co-designers of Powershell) states: "NOTE PowerShell uses the at symbol (@) in a few places, has $_ as a default variable, and uses & as the function call operator. These elements lead people to say that PowerShell looks like Perl." "In practice, at one point, we did use Perl as a root language, and these elements stem fr…

Perl had an amazing Win32 support back in the day, and still does. https://perldoc.perl.org/Win32 https://metacpan.org/search?size=20&q=win32 RAS, OLE, COM, ODBC. Perl did magick on NT/2K/XP.

And it was (may still be) used in the Windows build environment!

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

#136
post #95
post #91

Modernism: "Less is more"—Mies van der Rohe Postmodernism: "Less is a bore"—Robert Venturi ————— Guided by these famous quotes, if I were to call a programming language a "Modernist" language, I'd think of something that prizes elegance. It can't just be a small language, it has to be a small language with a few features powerful enough to actually do more. I would think of languages like Scheme or Smalltalk or C as…

p.s. This is fun. So what constitutes a Brutalist programming language? It should be something that: - Exposes the construction materials - Implies mass and permanence - Is usually institutional, e.g. libraries, government buildings, public housing. Only rarely shopping centres or company head offices (which were usually done in the "International" style when Brutalism was a thing). What fits that bill? How about SQL…

Forth. It was in OpenBIOS, it exposes the internals, you can define all its standard words by itself.

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

#137
post #109

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…

+1 to that. I'll add the other thing that gave PHP an edge at the time: Installing any major work built in Perl back then was a nightmare of installing all the underlying dependency modules, often into the system directories. It didn't have a clean, standardized way to package up a script + dependencies easily, and dependency management was hellish, especially with many key modules needing platform-specific C compila…

No CPAN and local::lib?

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

#138

Earlier quoted context omitted.

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

That doesn't really capture what's been happening. If feature bundles are still today's plan, it's only because the multiple attempts to get strict on by default have so far all been defeated. They are still pushing forward adding options to disable features like indirect calls, multidimensional hashes, bareword filehandles, etc. And you can bet that at some point they will revive the idea of moving to Perl7/8/9 and…

> They are still pushing forward adding options to disable features like indirect calls, multidimensional hashes, bareword filehandles, etc.

Personally, so long as all that stuff's behind a feature bundle I'm all in favour of it.

A little nitpick: it's not about "multidimensional hashes", but rather "multidimensional array emulation". Steer clear of it, if you can.

I personally don't mind using variables like $; or whatever. Some prefer to "use English" and use longer variables name for the same effect. More power to them.

I just wrap the call with the proper "## no critic (...)" and off I go.

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

#139
post #21

Earlier quoted context omitted.

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…

On DOS it also came into play in how line endings were handled.

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

#140

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…

I only touched Perl a little bit, at the start of my career in the mid-to-late 00s. I didn't hate it. For our specific use case, which was generating reports from large groups of text-based log files, it was wonderful. I'm curious, though, do you have any Perl programs you've worked on recently that are public? I'd love to take a look at how people are writing Perl these days...

check my profile :)

template default perl

Post reply on HN