Live data from Hacker News

Perl, the first postmodern computer language (1999)

wall.org

181–190 of 225 posts

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

#181
It's interesting seeing this conception of post-modernism 20 years down the track. I think the article almost gets at the point, but overshoots and ends up in navel-gazing territory with:

"Look at the big picture. Don't focus in on two or three things to the exclusion of other things. Keep everything in context. Don't go out of your way to justify stuff that's obviously cool. Don't ridicule ideas merely because they're not the latest and greatest. Pick your own fashions. Don't let someone else tell you what you should like. 'Tsall good."

Post-modernism is not so much about picking-and-choosing and going-your-own-way, but it is about looking at the big picture and keeping everything in context. Importantly it's not about the total rejection of assumption and consistency, but about critically challenging and analysing them.

I think a lot of folks unfortunately continue to approach it in this same way, but in 202X we often make the additional mistake of assuming that the "modernism" that "post-modernism" is rebelling against is our contemporary "modern" society. That often gets misrepresented as a rejection of the enlightenment or some other extreme sounding position, but it's much better understood as a challenge of epistemic certainty and an attempt to break down and understand our ideological assumptions.

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

#182

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…

Curious - is there a reason to use Perl (Wall's latest version, 5 or whatever) in 2022 if one has no familiarity with the language? What would be the major advantage of using Perl over its closest analogues, some bastardization of Bash and Python?

This is one way to think about it. If you take your glasses off and squint a little, underneath perl and python work in extremely similar ways, and basically do the same thing. Python is a dynamic language created to provide uniformity of syntax. Perl is a dynamic language designed to provide flexibility of syntax - wherein it has natural language features like list/scalar context.

Both of these approaches have their advantages. I have a saying I overuse: "Python helps you think more like the computer does, Perl helps the computer think more like you do". The consequence of this is that python is good at helping people think about tasks that the computer is good at in - like statistical problems. On the other hand perl is good at helping to contain the mess and chaos of the real world in a way that makes it more tractable for the computer - which is why it remains popular in the recruitment industry backends and other less tidy business areas.

Perl's very raw unvarnished object model is in fact based on python's, so it is very similar, but it's also built for flexibility. This means object models like Moo[1] which are really nice flexible and done right make it really easy to write extendable applications. Implementing python's object model in perl (i.e pretty much the exact specification) is easy. However you can't implement perl's object model in python except by messing with the guts of the python interpreter.

I haven't done any commercial python - I only have a passing aquaintance really from messing with sympy and the like. But boy perl has been good to me. I earn a good living in an interesting job and I can maintain interests out of work as well. And I haven't had to look hard for work for years. Of course currently I'm neck deep in recursive SQL queries.

[1] https://metacpan.org/pod/Moo - My favourite job to date was building a back end to spin up network devices, that got one gentle refactor after the initial implementation and was then subsequently extended to three or four completely different network device architectures extremely quickly. Mostly by virtue of making almost every object property read only and memoised on demand (extensions to existing methods would are likewise inlined on complilation - all done with object composition rather than inheritance too for an added layer of sanity)

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

#183

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, su…

I sympathise with your desire to replace shell scripts, but I don't see why that replacement should be Perl of all things. Like you said, Python has displaced Perl due to ecosystem support, so why chase history here?

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

#184

Earlier quoted context omitted.

Well, Larry Wall's latest project was called "Perl 6" but has been renamed "Raku"-- in belated recognition that it really is a new language, and Perl is going to continue being Perl. The main reason to learn Raku at present is simply that it's profoundly different from most other things out there-- there's no particular "killer app" that's emerged for it, but it's unusual enough that this might happen yet (no one exp…

Thank you to provide 1, 2, 3 above. I didn't know about these! I am surprised you didn't mention Perl 11 which is try to mash Perl 5 and 6/Raku together. Is that still happening? Or do I have it wrong? "How Perl compares to Python": The first thing I tell Perl programmers who are starting to learn Python: There are Perl-style references in Python. (If you are not familiar with Perl: These are a roughly pointers, and…

Ruby is a much more hospitable environment for ex-Perl people, IMHO.

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

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

It fit well with the network code where the other side is never be sure. Text interaction is a good initial way out of it. From old ftp, http, telnet … Xml and even json even if they are “structured” or fsm at least they are text. We can read the log.

I prefer text. Binary is too early optimisation and record oriented is too restricted.

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

#186

Earlier quoted context omitted.

Thank you to provide 1, 2, 3 above. I didn't know about these! I am surprised you didn't mention Perl 11 which is try to mash Perl 5 and 6/Raku together. Is that still happening? Or do I have it wrong? "How Perl compares to Python": The first thing I tell Perl programmers who are starting to learn Python: There are Perl-style references in Python. (If you are not familiar with Perl: These are a roughly pointers, and…

Ruby is a much more hospitable environment for ex-Perl people, IMHO.

I was 50/50 in 2011 between Python and Ruby (Django / Rails). Went with python in the end, kind of glad I did. Ruby has fallen off a lot in popularity, while python hasn't. Also Python seems to be a lot more general purpose, while ruby is a lot more web development focused.

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

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

It's Forth.

> Exposes the construction materials

Unlike most programming languages, the user has to keep the Stack in mind when programming.

> Implies mass and permanence

Its minimalist design made it extremely small and efficient

> Is usually institutional

I'm not sure how that fits into a programming language. But Forth is often used to write things like bootloaders due to its minimalism.

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

#188
post #143
post #77

Earlier quoted context omitted.

Most awk/cut/whatever commands can be done with perl -ne in about 2x the keystrokes, but you don't need to learn the other tools. In Python, the multiplier is much higher, and I could never get the oneliner stuff to work.

I don't understand why Python is touted as some kind of replacement for Perl when there are many things Perl does better and faster. Python isn't even optimised for one-liners so how can it be compared with Perl?

I moved from Perl to Python around 2011, mainly for Django.

Perl is a more expressive, "cleverer" language. But I noticed when I moved to Python that I write better code. Too often in Perl I would try something clever and terse, then two days later it would bite me in the bum and cause more problems than it solved.

I would still pull out Perl for some quick bash replacement type script, regular expressions are so much nicer in Perl, but for larger scale long term projects where maintenance is important, I would go for Python.

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

#189
post #41
post #5

Perl rose to popularity because early web development was all about text processing (reading web forms and outputting HTML) and Perl made that easier (regex deluxe) than other choices on unix at the time. It became the lingua franca of web developers. Perl 5 made heavy use of symbols so it was visually noisy, and then Perl 6 came along and added even more magic meanings to other symbols, and that was a tipping point…

If I understand right you are saying that the # of symbols Perl employs makes it hard to understand or read, correct? TL;DR; I would say that you assertion is context sensitive. - For a junior Perl programmer or an outside expert those symbols are stumbling blocks. - For an intermediate Perl programmer and up, those symbols are tools that make the code more readable and expressive. I got two ways of looking at that.…

An excellent heuristic proposed e.g. in the book "Modern Perl" (2015) [1] is to think of $_ as the pronoun it in human language, and @_ as the pronouns they/them.

Edit: a previous HN comment thread on how sigils are derived from practical linguistics: https://news.ycombinator.com/item?id=26659322

1: https://pragprog.com/titles/swperl/modern-perl-fourth-editio...

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

#190
post #28
post #9

Earlier quoted context omitted.

Interesting take, but as someone who still works regularly with the shell, I'd say there is still a place for small core utils connected together with pipes/textual streams. If we're talking parsing and chopping up text files, I can usually whip up something with awk/jq/cut/whatever in far less time than writing an equivalent Python script. There's a threshold where you prefer to switch to the scripting language for…

I agree with this threshold idea, and I would argue that Perl and probably Ruby also have a lower threshold for switching than Python. Nothing against Python.

Having moved from Perl to Python, there isn't really anything difficult in switching. I looked at Ruby too, which felt like a tidied up version of Perl, especially regarding
Post reply on HN