Any good reasons not to build web apps and API backends with Perl these days?
Half My Life with Perl
111–120 of 139 posts
Re: Half My Life with Perl
#112Earlier quoted context omitted.
I believe Perl got Unicode to a usable state long before Ruby. Ironic, given Ruby's origins.
It's not a race. Perl got there fast by basically not giving a damn about anything. Perl (talking about Perl 5, don't know anything about Raku, don't want to know anything about Raku) simply treats strings as sequences of numbers without requiring numbers to be in the 8-bit range. This makes it easy to say that those numbers could in principle be Unicode codepoints. The problem is that the actual assumptions about wh…
Re: Half My Life with Perl
#113Earlier quoted context omitted.
Plain perl: open my $fh, ' Nicer: use File::Open qw(fopen); ... my $fh = fopen $filename; (and File::Open is simple pure perl code so if I need to distribute the script to random machines I throw App::FatPacker at it to produce a bundled version)
"my $fh" works fine if you only want to work with files you open() yourself, but what if you want to write a function that, based on some test, returns either that or the preexisting STDOUT filehandle?
sub foo {
if (whatever) {
open my $fh, ...;
return $fh;
} else {
return \*STDOUT;
}
}
will do the job.Re: Half My Life with Perl
#114Earlier quoted context omitted.
"my $fh" works fine if you only want to work with files you open() yourself, but what if you want to write a function that, based on some test, returns either that or the preexisting STDOUT filehandle?
sub foo { if (whatever) { open my $fh, ...; return $fh; } else { return \*STDOUT; } } will do the job.
Re: Half My Life with Perl
#115I’m about to turn 40 and have been thinking if I should learn Perl or AWK or go with a “modern” solution for text wrangling on the command line. The general advice here seems to be “learn Perl while young”
Perl had three huge advantages (at least for me) when I first used it in 1992: 1: familiar syntax which paralleled well-loved tools (sed, troff, grep) 2: associative arrays as a built-in 3: regular expressions as a top-level language feature (not buried in some library with clunky syntax). A few years later, CPAN was another huge advantage.
Nowadays, syntax compatibility with sed is a disadvantage not advantage, associative arrays/dictionaries exist or are easily available for basically every language, and CPAN was the model that everybody else copied or did better. So really the "regexp syntax is immediately available" is the only remaining advantage, and it's rare that it would be worth it.
Re: Half My Life with Perl
#116My then-girlfriend and I, kicking it O'Reilly style, 1996: https://i.imgur.com/PPmZs9P.jpeg
Re: Half My Life with Perl
#117Earlier quoted context omitted.
Raku is basically perl 6 and has some features that blew my mind when I tried it a few years back. Never really did much with it, but it was enjoyable to learn.
This encapsulates every conversation I have ever had with someone who tried Perl 6: Tried it, was blown away with [some aspect of it], never found anything practical to do with it, never used it again.
Re: Half My Life with Perl
#118Earlier quoted context omitted.
I agree with you that it is sad there isn't more diversity in languages and tools, and that generally organizations are using the same terrible slop. We could have such nice things You lose me with the smugness. Make no mistake, you aren't smarter or better than someone else purely by virtue of your willingness to hack on BEAM languages or smlnj or Racket or whatever languages you like. There are probably people smar…
That sounds like post facto rationalization, sour grapes, and perhaps a bit of learned helplessness. To paraphrase you ‘We can’t have nice things because nice things are in reality bad and unrealistic. People who do have nice things are not special.’ I could readily believe that your stated reality is true of the majority of solo devs, but it’s not true for me or those that I know. I understand that my sampling is bi…
Any success I have had in getting very boring companies to adopt nice things at all has not come from insulting people's intelligence and acting like I'm the smartest person in the room. I despise this kind of elitism that is rampant in certain technical communities. It turns people off like nothing else and serves no purpose other than to stroke your own ego -- it's pointless meanness.
Re: Half My Life with Perl
#119Earlier quoted context omitted.
What's the modern solution to text processing on the command line? I don't think anyone tried seriously addressing that use case after Perl. Like, obviously you can do text processing in any language, but you're not going to be doing it in the context of shell pipelines and one-liners. The preferred interaction modes are totally different.
That was bad phrasing on my part, I meant "Is there a modern alternative I should go with instead?" - I also don't know what it would be. But I would love to know if there is a non-regular expression language with native support for csv, json and yaml that one can pipe files in and out of.
Re: Half My Life with Perl
#120Earlier quoted context omitted.
That sounds like post facto rationalization, sour grapes, and perhaps a bit of learned helplessness. To paraphrase you ‘We can’t have nice things because nice things are in reality bad and unrealistic. People who do have nice things are not special.’ I could readily believe that your stated reality is true of the majority of solo devs, but it’s not true for me or those that I know. I understand that my sampling is bi…
It's not learned helplessness et al, just a plea to drop the smug elitism if you want people to take you seriously. I actually want nice things, I hate writing brittle systems in languages that offer no meaningful guardrails, and setting up Rube Goldberg contraptions to get a poor approximation of e.g. basic BEAM runtime functionality. Any success I have had in getting very boring companies to adopt nice things at al…
My goal has not been to fix big companies for a long time, I was just musing on the rational and commented to see what other people think on the topic.