Questions tagged [raku]

For questions relating to the Raku programming language (formerly known as Perl 6).

Raku

Raku is an expressive and feature-rich programming language designed by Larry Wall and developed by the community.

Features include:

  • Object-oriented programming
  • Functional programming primitives
  • Parallelism
  • Concurrency
  • Asynchrony
  • Definable grammars for pattern matching and generalized string processing
  • Optional and gradual typing
  • Extensive Unicode support from code points to grapheme clusters
  • Multiple dispatch
  • Introspection
  • Rational numbers

is a Raku implementation that targets multiple back ends.

The MoarVM back end is recommended for normal use, but back ends for the Java Virtual Machine and JavaScript are also under active development.

The Rakudo implementation shipped a first official release named “коледа” on December 25, 2015. Most of the specification is frozen, and optimizations are ongoing.

Official links

1993 questions
49
votes
6 answers

Why does integer division round down in many scripting languages?

In the languages I have tested, - (x div y ) is not equal to -x div y; I have tested // in Python, / in Ruby, div in Perl 6; C has a similar behavior. That behavior is usually according to spec, since div is usually defined as the rounding down of…
jjmerelo
  • 22,578
  • 8
  • 40
  • 86
44
votes
2 answers

What's the deal with all the different Perl 6 equality operators? (==, ===, eq, eqv, ~~, =:=, ...)

Perl 6 seems to have an explosion of equality operators. What is =:=? What's the difference between leg and cmp? Or eqv and ===? Does anyone have a good summary?
raldi
  • 21,344
  • 33
  • 76
  • 86
39
votes
5 answers

Can only 'perl6' parse Perl 6?

There's that (relatively) well known Perl axiom, "Only perl can parse Perl." I'm wondering, will that remain true for Perl 6? Expanding the discussion... I thought of this question given the recent update of PyPy. Does Perl's unique parsability…
Mark Canlas
  • 9,385
  • 5
  • 41
  • 63
32
votes
5 answers

What performance increases can we expect as the Perl 6 implementations mature?

Each time I have downloaded a new copy of Rakudo Perl 6, I have run the following expression just to get an idea of its current performance: say [+] 1 .. 100000; And the speeds have been increasing, but each time, there is a noticeable delay…
Eric Strom
  • 39,821
  • 2
  • 80
  • 152
31
votes
2 answers

The performance penalties for types/constraints in Raku?

In contrast with Perl 5, Raku introduced gradual typing. The landscape of gradually typed object-oriented languages is rich and includes: Typed Racket, C#, StrongScript, Reticulated Python. It's said that "optional gradual type-checking at no…
Nile
  • 319
  • 2
  • 5
28
votes
4 answers

What is the current state of Perl 6?

What is the current state of Perl 6, is it production-ready? Where do we stand right now? There are many programmers curious about the current progress of Perl 6. There are also two other topics open on on reddit and…
Cobalt
  • 289
  • 3
  • 3
28
votes
5 answers

Is it worth learning Raku (previously known as Perl 6)?

I have the opportunity to take a two day class on Perl 6 with the Rakudo compiler. I don't want to start a religious war, but is it worth my time? Is there any reason to believe that Perl 6 will be practical in the real world within the next two…
Andres
  • 5,012
  • 3
  • 24
  • 36
28
votes
7 answers

How does Parrot compare to other virtual machines?

Parrot is the virtual machine originally designed for Perl 6. What technical capabilities does the Parrot VM offer that competing virtual machines such as the Java Virtual Machine (JVM)/Hotspot VM and Common Language Runtime (CLR) lack?
knorv
  • 49,059
  • 74
  • 210
  • 294
27
votes
6 answers

How does Perl 6 evaluate truthiness?

In reading about Perl 6, I see a feature being trumpeted about, where you no longer have to do: return "0 but true"; ...but can instead do: return 0 but True; If that's the case, how does truth work in Perl 6? In Perl 5, it was pretty simple: 0,…
raldi
  • 21,344
  • 33
  • 76
  • 86
26
votes
8 answers

I know Perl 5. What are the advantages of learning Perl 6, rather than moving to Python?

Coming from a Perl 5 background, what are the advantages of moving to Perl 6 or Python?
raldi
  • 21,344
  • 33
  • 76
  • 86
24
votes
3 answers

How to check if a file is a text file?

Does Perl6 have something like the Perl5 -T file test to tell if a file is a text file?
sid_com
  • 24,137
  • 26
  • 96
  • 187
23
votes
2 answers

Implementation of a function object "power" operator in Raku

In APL there is the power operator ⍣, which if applied to a function f superimposes the application of f. How to implement that operator in Raku? For example, with this definition of f: sub f(Int:D $i){ $i + 1 } the command say (f ⍣ 4)(10); should…
Anton Antonov
  • 726
  • 4
  • 11
23
votes
2 answers

Pass an operator like a function

While learning Raku, I arrive to the point of higher order function and the sort function. I have this example: > sort <4 6 2 9 1 5 11> (1 2 4 5 6 9 11) Then the doc for the routine says this: Sorts the list, smallest element first. By default…
anquegi
  • 11,125
  • 4
  • 51
  • 67
22
votes
2 answers

Concatenating `s///` in raku

I find that a huge selling point for scripting addicts to join raku would be having such constructs possible my $w = "Hello world"; $w ~~ s/Hello/Hola/ ~~ s/world/mundo/ ; say $w; # » Hola world However I don't seem to be able to write…
margolari
  • 651
  • 3
  • 11
22
votes
1 answer

Extracting from .bib file with Raku (previously aka Perl 6)

I have this .bib file for reference management while writing my thesis in LaTeX: @article{garg2017patch, title={Patch testing in patients with suspected cosmetic dermatitis: A retrospective study}, author={Garg, Taru and Agarwal, Soumya and…
Suman Khanal
  • 3,079
  • 1
  • 17
  • 29
1
2 3
99 100