I still remember a wonderful presentation by Damian Conway a number of years ago about all of the great ways Perl 6 could turn into whatever domain specific language you needed it to be. It was beautiful, I was awestruck. I've always enjoyed Perl as a language . But I walked out of that presentation thinking "That was so beautiful, and I don't want it anywhere near my business." Because the last thing I need is softw…
> I never liked Python much, until I got forced to use it on a new team. Now I'm convinced that it has a really distinct advantage -- there aren't too many ways to write Python, so an experienced Python developer can figure out code pretty quickly. This is why I picked up Python many years ago. I had been using Perl 5 for my scripting and system administration needs. While it worked just fine any project larger than…
What Happened to Perl 7?
241–245 of 245 posts
Re: What Happened to Perl 7?
#242Ah Perl! The old friend, you can always rely on to do quick scripting work. I've written non-trivial quantities of Perl in the past, and maintained other people's Perl code too. Contrary to popular opinion, I've always found it easy to maintain. I still call upon Perl to do open(FILEHANDLE, $file) or die; while( ){ .... } close(FILEHANDLE) Sort of work. These days I do good deal of work in Python. Python itself has b…
Examples? I don't recognise anything Perlish in Python. Ruby, yes, but not Python.
(I showed my co-workers `perl -d`, they later discovered and showed me `python -mpdb`)
Re: What Happened to Perl 7?
#243I’m disappointed in the way this Perl 6 v Perl 7 debate is developing. Perl 6 modernizes Perl with e.g. concurrent and reactive programming, built-in grammars and a reimagined regex syntax superior to legacy PCRE, named function arguments, and gradual typing. Perl 6 was designed to be the successor language to Perl 5. The only technical grounds for Perl 6 being metaphorically sidelined was because Perl 6 lacked the s…
I think more than anything it was an error in the messaging. Perl 6 was treated as the successor of Perl 5 -- and that was the mistake. It meant Perl 5 started dying, since people assumed that Perl 5 would be soon dead, and Perl 6 had a new different syntax. And then it took 15 years to happen, during which Python and others ate its lunch. I think a more successful strategy would have been to make it clear very early…
Raku’s built-in grammars make parsers trivial to write. I effortlessly created two [2] — one for reordering fstab entries, and the other for converting human-readable LUKS offsets into cryptsetup sectors — on a lazy afternoon. Grammars in Raku make this second nature.
Then you have Raku’s multi-dispatch. It is more capable than Erlang/Elixir pattern matching:
# a list with at least one element, extracting the head and tail
multi sub tail(*@list ($head, *@tail)) { @tail }
multi sub tail(*@list) { @list }
[3]
==> tail()
==> say(); # []
[3, 4]
==> tail()
==> say(); # [4]
# pattern matching with arbitrary guards
multi sub user($name where { is-valid-user($_) }) { $name.say }
multi sub user($name) { "invalid name: $name".say }
sub is-valid-user($name)
{
# notice the additive character class in this regex: “letters plus digits”
# fail the match if $name is root
try with $name ~~ /(+)/ { $0 ne 'root' or fail }; $!.not
}
user('name'); # name
user('1234'); # 1234
user('root'); # invalid name: root
class Coordinates
{
has $.latitude is required;
has $.longitude is required;
}
class City
{
has Str:D $.name is required;
has Str:D $.state is required;
has Str:D $.country is required;
has Coordinates:D $.coordinates is required;
}
my $latitude = -37.840935;
my $longitude = 144.946457;
my Coordinates $coordinates .= new(:$latitude, :$longitude);
my Str:D $name = 'Melbourne';
my Str:D $state = 'Victoria';
my Str:D $country = 'Australia';
my City $melbourne .= new(:$name, :$state, :$country, :$coordinates);
my City:D $sydney = do {
my Coordinates:D $coordinates = do {
my $latitude = -33.86514;
my $longitude = 151.209900;
Coordinates.new(:$latitude, :$longitude);
};
my Str:D $name = 'Sydney';
my Str:D $state = 'New South Wales';
my Str:D $country = 'Australia';
City.new(:$name, :$state, :$country, :$coordinates);
};
# deeply nested argument deconstruction
multi sub melbourne-or-bust(
City:D $city (
Str:D :$name where 'Melbourne',
Str:D :$state,
Str:D :$country,
:$coordinates (
:$latitude,
:$longitude
)
)
)
{
my $gist = qq:to/EOF/.trim;
Welcome to the city of $name. It’s located in $state, $country.
GPS coordinates: $latitude, $longitude
EOF
$gist.say;
}
multi sub melbourne-or-bust(City:D $city)
{
'This isn’t Melbourne.'.say;
}
melbourne-or-bust($melbourne); # Welcome to the city of Melbourne ...
melbourne-or-bust($sydney); # This isn’t Melbourne
> Perl 6 was treated as the successor of Perl 5 -- and that was the mistake. It meant Perl 5 started dying,Perl 6 took a long time to make, but how much did that matter? What was Perl going to do about Rails, Clojure, Go, Rust, JS/TS, and more? The world of programming languages used to be a lot smaller than it is today.
> Perl 6 had a new different syntax.
Inline::Perl5 [3] allows running legacy Perl 5 code in Perl 6 codebases.
[1]: https://docs.raku.org/language/5to6-nutshell#Regular_express...
Re: What Happened to Perl 7?
#244Earlier quoted context omitted.
> The languages that truly let you do anything you want flexibly invariably lead to incomprehensible ivory towers. It is why managers hate Lisp, it's why Perl is joked as write-once read-never. I've yet to see that happen in a Lisp project. On the other hand, inflexible languages like Java lead to abominations like the Spring framework, where tons metaprogramming happens at runtime via reflection. The thing about com…
> People are always worried about DSLs, but most projects end up with their own DSLs. They're just often built out of functions, methods, objects, etc. I wish there was a kind of super-upvoting that added one to the font-size of the comment you're upvoting, because I would absolutely super-upvote this comment. > Abstraction is a way to get that complexity filtered down as close to the problem's inherent complexity as…
Re: What Happened to Perl 7?
#245I’m disappointed in the way this Perl 6 v Perl 7 debate is developing. Perl 6 modernizes Perl with e.g. concurrent and reactive programming, built-in grammars and a reimagined regex syntax superior to legacy PCRE, named function arguments, and gradual typing. Perl 6 was designed to be the successor language to Perl 5. The only technical grounds for Perl 6 being metaphorically sidelined was because Perl 6 lacked the s…
I think more than anything it was an error in the messaging. Perl 6 was treated as the successor of Perl 5 -- and that was the mistake. It meant Perl 5 started dying, since people assumed that Perl 5 would be soon dead, and Perl 6 had a new different syntax. And then it took 15 years to happen, during which Python and others ate its lunch. I think a more successful strategy would have been to make it clear very early…
In 2000, for all intents and purposes, Perl 6 was the successor of Perl 5. And one of the reasons the project was started, was because Perl 5 was already dying at that point. Not only losing the web server competition to PHP, but also from internal battles, close to civil war.
The internal battles ceased for a while when the Perl 6 process was started. But around 2008, it became a war between Perl 5 and Perl 6. To squelch that, the sister language meme was born. But that just meant a cease-fire, rather than peace, and the dissent and resentments continued to fester under the blanket of the sister language meme.
Until 2019, when the rename of Perl 6 to the Raku Programming Language happened. Factions within Perl 5 lost their common enemy, and fighting could start all over again. Which caused at least one pumpking to resign.
To mark Perl 6 as the cause for Perl 5's demise, is incorrect. Perl 6 was one of the effects of Perl 5's demise.
Meanwhile the Raku Programming Language continues to build a programming language of the future. You can check out the Rakudo Weekly News if you want to stay up-to-date on developments https://rakudoweekly.blog