This is great news both for Perl and for Raku. I will probably bother to take a serious look at Raku now, sometime, if anything just for curiosity. Why not before? I have no good answer for that.
But my main worry about it is that I suspect it has brought along with it the community's dysfunctional fascination with over-the-top cleverness and arcane constructs. I'll probably stick with Python and Perl 5 on an as-needed basis, but Raku will be fun to look in on for brain stimulation.
My best case hope is maybe it's clarified some things! Like having an agreed on best practice for how objects are implemented, that would be nice.
I was a Perl dev a long time ago, and I think it made me a stronger coder. I still miss it, and I've not coded Perl for real in a decade.
You're correct about "over-the-top cleverness and arcane constructs" being a problem, but it's also about using code as communication. We code in _languages_, and on one extreme is coding newpaper style - lowest common linguistic denominator. On a good day this is a common, understandable language, and on a bad day it is trying to communicate with stilted baby talk. On the other extreme is dense linguistic cleverness. On a good day this is nuanced yet clear and informative, on a bad day it is James Joyce.
As coders we like to talk about using the right tool for the job, but in code we so often assume that the most stilted repetative pattern is always best. It often is - like newspapers, we can't (or shouldn't) assume our audience is well-versed in our material. But we have other constraints as well. I often argue in favor of _skimmability_ over _readability_ of code. That means that the attention/focus of the eye is important. Stilted languages with minimal syntax give you almost no control over that. More fluid languages like Perl give you a lot more flexibility. Learning to use that flexibility to increase clarity...for MOST people, not just for yourself...is a skill that most of us have only limited practice at, and none of us have mastered.
But it's a good idea to work at it, and when done well you communicate MORE with LESS, and it's something people notice because it's not buried in the midst of visual noise.
Interesting perspective there. Worth noting that Larry Wall trained as a linguist and "often compares Perl to a natural language and explains his decisions in Perl's design with linguistic rationale" [0]
> On a good day this is nuanced yet clear and informative, on a bad day it is James Joyce.
So true. I think Perl golf could be Samuel Beckett.
> On a good day this is nuanced yet clear and informative, on a bad day it is James Joyce.
If Raku's "bad day" is basically like "one of the most influential and important authors of the 20th century" (according to Wikipedia)… well, then, maybe I should check Raku out!
I think the reference was to languages in general. In James Joyce's Ulysses there are four or five chapters which all tell basically the same story, but written in wildly different styles - one like an ancient legend, another a 'stream of consciuosness', and so on.
Why not before? Because Perl is you know, dead. Jokes aside, it's a pretty nice language apart from the !$double .@sigils. If I'd switch from Perl 5, I'd probably switch to Ruby, as Perl 6 oops Raku is quite slow.
In this case, `!$double` isn't a sigil. `!` is just the old prefix operator for negating a value [1]. If you meant to write `$!double`, then it's the twigil [2] for class attributes [3]. Twigils could be considered as secondary sigils but they affect the scoping of a variable. In this instance, `!` is for class attributes and will only be found there.
As for `.@sigils`, I've never seen this syntax. I'm probably out of the loop in this one.
As an aside, sigils are one of Raku's interesting features. They convey information [4] that might not be easy to discern from just looking at the code. What kind of structure is this variable holding? Is it holding an array? A hash? A code object? What's the scope of this variable? Is it class-scoped? Is it dynamically-scoped? Is it a compile-time variable?
> ... Raku is quite slow.
This is a legitimate reason for avoiding the language. However, it's worth pointing out that Raku core developers have made great improvements to the language in the speed department since it was first officially released in 2015. They recognize there's a lot of room for improvement. [5]
Ok, twigils, whatever. They're next to each other so they're double the crazyness. Like the $#last_index in Perl. In Raku the . and ! are used to designate a private or public variable within a class definition. I got it backwards, which sort of proves the whole point. Push a private array nested into another and you have a bunch of gibberish worse than in Perl, where you'd only prefix it with \. Use an auxilliary variable and it feels too verbose. OTOH @{$hash{array_ref}} dereferentiation in Perl is quite annoying. And no, $hash{array_ref}->@ is definitely not how you fix this mess. I agree that sigils offer some insight into what type of the variable you are looking at.
Great improvements are not enough compared to other languages, even Ruby which is quite slow itself. Have you wrote anything in Node, Dart or Lua? They feel like a F1 car where Raku is an 17th century cart.
%hash is an actual hash with a nested array ref inside. If $hash is a reference to such a hash, yes. Never used the second syntax and I doubt that it works with something other than subroutines, but in that case it's either hash() where hash is an actual sub, or $hash->() where $hash is a subroutine reference. Both return an array refetence.
See? Confusing. That's why people hate Perl. At least I'm glad dereferencing is gone in Raku.
Ruby is also quite slow. The last benchmarks I saw makes it pretty clear Raku has closed the gap with Ruby (at least the mainline C implementation of Ruby) on a lot of fronts, and is likely to be faster for many things in another year or two and the VM gets better at optimization. My google fu isn't up to finding those benchmark results now, but it's no secret that Ruby is pretty sluggish compared to Perl 5.
I sure hope it will be faster because in my own tests it's slower than Tcl. And I've tested at least two releases a year since october 2016 when the stable Rakudo came out.
Ruby 2.5 has a jit which uses the C compiler to generate dynamically linked objects. It looks more like a workaround but it produces fast code. Then there's Jruby, Rubinius, Truffle, mruby. Crystal too, which is a different language but yet similar. No need to learn Go. Just take your Ruby background and pretty much start using it for writing Crystal.
But my main worry about it is that I suspect it has brought along with it the community's dysfunctional fascination with over-the-top cleverness and arcane constructs. I'll probably stick with Python and Perl 5 on an as-needed basis, but Raku will be fun to look in on for brain stimulation.
My best case hope is maybe it's clarified some things! Like having an agreed on best practice for how objects are implemented, that would be nice.