7 ms·
perl has the distinction of being designed by a linguist and, for many coders (like me), it has a very smooth and easy feeling … … others dislike the idea of $
by librasteve 3y ago
perl has the distinction of being designed by a linguist and, for many coders (like me), it has a very smooth and easy feeling …
… others dislike the idea of $ sigils as “noun” markers and @ sigils to denote plurals but imo these features trick your brain into engaging these natural language concepts.
In contrast, I feel that Java is “heavy”, Python is “sciency” and so on.
The other distinctive aspect of perl is that it does not seek to constrain and block the coder. Strongly typed and opinionated languages (like Rust and Haskell) can be frustrating since they force you to code their way. That’s fine - it’s in the contract. perl is for when you just want a bag of tools to get the job done without becoming a wrestling match.
This flexibility also means that non standard code is easier to write in perl. The tool gets a bad reputation at the hands of poor coding practices. A higher level of trust and self-discipline is needed.
perl6 - now renamed to www.raku.org, continues the spirit with a cleaned up syntax and a lot more features in the core language
- washadjeffmad 3y agoSurprisingly (but not really), I found myself in a position to harness my late-90s perl for cgi experience for the sciences after bioinformatics began to take off. Python makes quite a few things easier if only because of how "teachable" it is between colleagues, but the really useful tools that bear more in common with the human relationship with data as text-at-scale were part and parcel to the POSIX-likes. The biggest challenges I faced were getting IT to let me use Linux at work and convincing peers to try it.
- archargelod 3y ago> perl6 - now renamed to www.raku.org, continues the spirit ... With perl7 still being worked on, is it really a continuation or they're just branching off? I'm still not sure what's their relation to each other now. Why would one choose to use perl over raku or vice-versa?
- 7thaccount 3y agoMy understanding is that there is Perl 5 (which is Perl) and a completely separate language known as Raku that was originally supposed to be Perl 6. This happened as Perl 6 took so long (similar to Duke Nukem Forever) that large portions of the Perl community decided it wasn't a realistic upgrade path and the languages had a hard fork. Perl7 seems to be Perl5 with some changes to the defaults. They can't upgrade to Perl6 as that would be needlessly confusing. If foresight were perfect, Perl6 would have always been a different language name so Perl proper would continue without confusion. The problem was that they had no idea how hard it would be to make Perl6 and thus thought it would be ready in a few years (my understanding) and everyone would upgrade. Raku/Perl6 is SERIOUSLY COOL. I think it just needs a larger community and that's a chicken/egg problem.
- chromatic 3y agoYour understanding is mostly accurate. Perl 6 was intended from the start to be the next major release of Perl (at various times, a replacement for a 5.10 or 5.12 or 5.14), and it was intended to have a backwards compatibility mode to run 5.8 (or 5.10 or 5.12) code in the same process, with full interoperability. As time went by, that plan became less and less likely. Some people came up with the idea that Perl and P6 were "sister languages", both to have new major releases. I think this happened sometime around 2009 or so, maybe as early as 2007. Also by 2011 or so, the P6 developers effectively scuttled the backwards compatibility plan and code written to that point, but I've argued that their plan to replace Parrot was a mistake enough here and elsewhere already. (Sometimes I wonder, now that MoarVM is older than Parrot was when Parrot was declared unsuitable, if they've achieved their promised speed and compatibility goals.)
- 7thaccount 3y agoThanks Chromatic!
- librasteve 3y agoWell the raku community may be small (1300 ish on reddit) but it is very welcoming and there is lots to help out with (RakuAST anyone?). There are 2200 or so modules on www.raku.land (plus Inline::Perl5, Inline::Python, CFFI and so on) - I learn something every day by rubbing shoulders with some amazing experts!
- 7thaccount 3y agoYep. I hope I didn't comes across as negative. It's a good community from what I've seen.
- librasteve 3y ago(conceptually) it's a fork - long overdue really since the whole stack has diverged
- dontupvoteme 3y agoIndeed, Linguistics is a sincerely underappreciated field. It's telling that perl is/was absolutely functional at it's core -- a pidgin of bash and <proper programming>, if one might will.
- librasteve 3y agoyeah, raku takes the perl functional heritage and adds a bit my $logger = -> $m { say $m; $m }; my $add-five = -> $x { $x + 5 }; my $add-five-and-log = $add-five o $logger; say $add-five-and-log(25); # Prints 25, then prints 30 https://dev.to/rawleyfowler/functional-programming-with-raku-9ib https://dev.to/rawleyfowler/functional-programming-with-raku...
- tetha 3y ago> This flexibility also means that non standard code is easier to write in perl. The tool gets a bad reputation at the hands of poor coding practices. A higher level of trust and self-discipline is needed. And this becomes a problem in teams. I do somewhat miss perl, because perl and some libraries did some things better than later languages. You could express some ideas very concisely. Or, croak and carp only reporting functions crossing module or library boundaries in a stack trace (instead of some java teams complaining that the log aggregation refuses to collect 50kb+ sized stacktraces, not even exaggerating there). Alternatives like python force you into a more maintainable style. Like, don't get me wrong, you can write unmaintainable code in any language, and python would be my language of choice to make a horrible non-understandable mess with the extensive meta programming capabilities. But with perl, you kinda have to put in effort to stay on the simple path. If you leave that part, it quickly becomes very dark. And I know some of my co-workers.
- Enk1du 3y agoFor me, it's code review that makes me write in a maintainable style. It's the team that's responsible for a code base and objections are raised whenever anyone thinks that they'll struggle to understand this or that line. We also enforce consistency. Yes, you _can_ choose any character for quoting lists, but for the love of Pete, you _will_ follow how it's done in every other case (in that file, at least). I'll miss you qw//, but I was out-voted. :(
- sonofhans 3y agoqw// was always my favorite, too — distinctive, and quick to type.
- librasteve 3y agoqw/one two three/; in raku is <one two three>
- ReleaseCandidat 3y ago> perl has the distinction of being designed by a linguist ... who won the IOCC 2 times! https://www.ioccc.org/winners.html#W https://www.ioccc.org/winners.html#W
- librasteve 3y agoin 1986 and 1987 ... yikes https://www.linkedin.com/pulse/18th-december-day-perl-programming-language-/ https://www.linkedin.com/pulse/18th-december-day-perl-progra... Obfuscation coding contests, Perl golf tournaments to create the shortest feasible code for a specified function, and Perl-language poetry collections have all grown up as a result of Perl's versatility. Your takeaway may well be that perl is not the kind of thing that your boss would like. My takeaway is that perl (and raku) is versatile and engenders a sense of -Ofun.
- bloopernova 3y agoI really like Raku, but haven't yet tried to integrate it into anything I do. I was looking at fizzbuzz implementations on https://web.archive.org/web/20240116132452/https://rosettacode.org/wiki/FizzBuzz https://web.archive.org/web/20240116132452/https://rosettaco... (as you do), and liked the simplicity of a Raku solution: for 1 .. 100 { when $_ %% (3 & 5) { say 'FizzBuzz'; } when $_ %% 3 { say 'Fizz'; } when $_ %% 5 { say 'Buzz'; } default { .say; } }