3 ms·
Back in the day, I wrote a load of Perl 5 and certainly used to consider myself well-versed in it. Perl 6, at least seen through the lens of this post, doesn't
by tomalpha 9y ago
Back in the day, I wrote a load of Perl 5 and certainly used to consider myself well-versed in it.
Perl 6, at least seen through the lens of this post, doesn't appear to have fixed the write-only nature of Perl 5 and it's amazing ability to help you create truly obfuscated code first time round. No tools required.
unit module Jolly;
sub term:«\c[INVISIBLE TIMES]» is export { 42 }
sub infix:«\c[INVISIBLE TIMES]» is export {
$^a × $^b
}
sub prefix:«\c[INVISIBLE SEPARATOR]» (|)
is looser(&[,]) is export
{
say "Ho-ho-ho!";
}
In order to have the line:
say 42;
# OUTPUT:
# 1764
# Ho-ho-ho!
Neat tricks within the scope of the language itself perhaps, and despite everything it is great to see progress on Perl 6 even if only for reasons of nostalgia. Not a great advert for a modern language though.
- colomon 9y agoPerl 6 contains a bunch of really powerful tools, like the ability to create operators from any (non-whitespace) Unicode string, wrap subs and methods, or rewire the language's grammar on the fly. Unsurprisingly, this sort of power can cause a lot of trouble if used with ill-intent. It also can make for wonderfully expressive, clean programs.
- petre 9y agoWith great power comes great responsibility.
- smacktoward 9y ago> Perl 6, at least seen through the lens of this post, doesn't appear to have fixed the write-only nature of Perl 5 and it's amazing ability to help you create truly obfuscated code first time round. Despite all evidence, the Perl community persists in considering this a feature, not a bug. Which is a big part of why the Perl community is so much smaller these days than it used to be.