Remix.run Logo
MangoToupe 3 hours ago

Perl was (and still is) a very expressive and concise language for working with text and a unix-style system. It exists in the odd space between a shell language and a general purpose language.

But, shell scripting has already become somewhat of an arcane skill. I think the article nailed that Perl was just too hard to learn for the value it provided to survive. Python is not nearly as, erm, expressive as perl for working in that space, but it is much easier to learn, both in terms of reading and writing. In other words, it encourages broadly maintainable code. Ruby is quite similar (although I think people massively overstate how much the language itself generally encourages understandable semantics)

zahlman 3 hours ago | parent | next [-]

> Perl was (and still is) a very expressive and concise language for working with text and a unix-style system. It exists in the odd space between a shell language and a general purpose language.

GvR explicitly describes the motivation behind Python in similar terms (I can probably find a timestamp in that recent documentary for this). But the goal there was to be fully "general purpose" (and readable and pragmatic, more than artistic) while trying to capture what he saw as the good things about shell languages.

And it's changed quite a bit since then, and there are many things I would say with the benefit of hindsight were clear missteps.

We all joke about the hard problems of computer science, but it seems to me that the hard problems of programming language design, specifically (and perhaps software engineering more generally?) include having good taste and figuring out what to do about reverse compatibility.

> I think the article nailed that Perl was just too hard to learn for the value it provided to survive. Python is not nearly as, erm, expressive as perl for working in that space, but it is much easier to learn

The use cases have also changed over time. Quite a lot of developers ended up on Windows (although that pendulum is perhaps shifting again) where the rules and expectations of "shell" are very different. To say nothing of e.g. web development; long gone are the days of "cgi-bin" everywhere.

jordanb 3 hours ago | parent | prev | next [-]

Shell is a crappy scripting language because it has primitive data structures and data flow control making it hard to manage and manipulate data as you process it between applications. The fact that newlines are such a problem is a case in point.

Python is a crappy shell scripting language because the syntax around pipe and subprocess is really clunky.

Perl managed to have decent data structures and also have decent syntax around subprocess calls.

But I feel like the Python invoke module gives me everything I need wrt subprocess calls. I basically write any nontrivial "shell script" these days as a Python invoke command.

zahlman 3 hours ago | parent [-]

I assume you refer to https://www.pyinvoke.org/ which I just looked up. It looks quite promising, thanks for the heads-up.

zihotki 3 hours ago | parent | prev [-]

> Perl was (and still is) a very expressive and concise language

And that could be one of major reasons why it lost in popularity. It was and still is easy to write but hard to read.