News for hackers. Stuff that matters.
Re:Larry Wall has approved renaming Perl 6 to Raku by petre on Friday October 11, 2019 @04:47PM (#21228312)
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.
Re:Larry Wall has approved renaming Perl 6 to Raku by xisukar on Friday October 11, 2019 @05:39PM (#21228745)
> ... apart from the !$double .@sigils

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]

[1] https://docs.perl6.org/routine/!

[2] https://docs.perl6.org/language/variables#index-entry-Twigil

[3] https://docs.perl6.org/language/variables#index-entry-$!

[4] https://docs.perl6.org/language/faq#Why_sigils?_Couldn't_you...?

[5] https://docs.perl6.org/language/faq#Is_Perl_6_fast_enough_fo...?

Re:Larry Wall has approved renaming Perl 6 to Raku by petre on Saturday October 12, 2019 @01:57AM (#21230963)
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.

Re:Larry Wall has approved renaming Perl 6 to Raku by popovmp on Saturday October 12, 2019 @03:26AM (#21231242)
You probably mean: `@{ $hash->{array_ref} }` or `@{ $hash(array_ref) }`.

Either way shows exactly what is the structure of `hash`.

Re:Larry Wall has approved renaming Perl 6 to Raku by petre on Saturday October 12, 2019 @04:10AM (#21231421)
%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.

Re:Larry Wall has approved renaming Perl 6 to Raku by SwellJoe on Saturday October 12, 2019 @02:56AM (#21231148)
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.
Re:Larry Wall has approved renaming Perl 6 to Raku by yesbabyyes on Saturday October 12, 2019 @05:15AM (#21231672)
Here's a great talk from PerlCon.EU 2019 about Raku Performance given by Jonathan Worthington: https://perlcon.eu/talk/80
Re:Larry Wall has approved renaming Perl 6 to Raku by petre on Saturday October 12, 2019 @03:21AM (#21231229)
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.

Re:Larry Wall has approved renaming Perl 6 to Raku by jashmatthews on Saturday October 12, 2019 @04:38AM (#21231536)
The CRuby 2.6 JIT using gcc or clang improves some benchmarks but makes real applications slower, sadly.

Thankfully JRuby already has a functioning JIT and TruffleRuby is getting very close to a 1.0 release.