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
6
votes
1 answer

Perl6 Redis stuck when ask for output

For some unknown reason (not even in Redis log), this piece of code will stuck forever... Please help.. use v6; use Redis; my $redis = Redis.new("127.0.0.1:6379"); $redis.auth("xxxxxxxxx"); $redis.set("key", "value"); say $redis.get("key"); say…
Zarul Zakuan
  • 510
  • 3
  • 13
6
votes
2 answers

Perl6 assign regex match groups to variables

In P5, I am able to do something like this my ($var1, $var2, $var3) = $string =~ /(.+)\s(.+)\s(.+)/; How do I do the same in Perl 6? If I do the same syntax, the $var1 will hold the entire $string value.
Zarul Zakuan
  • 510
  • 3
  • 13
6
votes
0 answers

Installing Perl 6 to MSYS2 on Windows 10

I want to develop a GTK+3 app on Windows 10 using Perl 6 and its NativeCall library. I have installed MSYS2 and GTK+3 on it and could run an example GTK+3 C program using it. But I couldn't install Perl 6 on MSYS2. I have tried to search web for…
ismailarilik
  • 2,236
  • 2
  • 26
  • 37
6
votes
2 answers

How to share a variable between two routers module in cro?

I try to use Cro to create a Rest API that will publish messages in rabbitMQ. I would like to split my routes in different modules and compose them with an "include". But I would like to be able to share the same connection to rabbitMQ in each of…
STH
  • 63
  • 3
6
votes
1 answer

is export and binding in Perl 6

Why isn't the value of a variable with := binding exported? $ cat myModule.pm6 our $a is export = 42; our $b is export := $a; $ cat program.p6 use myModule; say $a; say $b; $ perl6 program.p6 42 (Any) # Why?
Eugene Barsky
  • 5,780
  • 3
  • 17
  • 40
6
votes
1 answer

Forcing installation order using zef

Lately, installing LWP::Simple requires the prior installation of IO::Socket::SSL, as is shown in this Travis log. However, there does not seem to be a way of forcing zef to install them in that particular order. The only way I can think of is to…
jjmerelo
  • 22,578
  • 8
  • 40
  • 86
6
votes
1 answer

Find out whether a container is a class or an object

I was curious about grammars being classes or singletons, so I created this small program to find out: grammar Mini { token TOP { \* \* } token word { \w+ } } proto sub is-class( | ) { * }; multi sub is-class( Grammar:D $g ) { return…
jjmerelo
  • 22,578
  • 8
  • 40
  • 86
6
votes
2 answers

Perl 6 script compiles to different targets

I have a Go Script which complied to Windows and Linux where i provide it to my customers. I started exploring Perl6 and want to write the new version with perl 6 , does anyone know if Perl 6 have any option like : Go build , GOOS AND GOARCH where…
jsor
  • 637
  • 4
  • 10
6
votes
2 answers

How to reload modules used in the REPL?

The question is pretty self explanatory. If I load a module in the REPL during development I would like to pick up changes without having to exit first.
matthias krull
  • 4,389
  • 3
  • 34
  • 54
6
votes
3 answers

Problem when using role between two module

I am making a module that has multi module file, and faced this problem when using role in different module. For example we have two module Foo and Bar, and there is a role in each module. module Foo { role foo is export { } } module…
araraloren
  • 185
  • 7
6
votes
1 answer

Traits, attributes, roles and closures

I'm continuing my quest into the deep waters of Perl6 subtle implementation details. This time I have a problem with installing own methods into a role. Fasten your seatbelts please as we start the journey into the code. The idea is an attribute…
Vadim Belman
  • 1,210
  • 6
  • 15
6
votes
2 answers

perl6 How to give more memory to MoarVM?

I have to run data analysis on about 2 million lines of data and each line about 250 bytes long. So total about 500 megabytes of data. I am running latest Rakudo on Virtualbox Linux with 4G memory. After about 8 hours, I got MoarVM panic due to…
lisprogtor
  • 5,677
  • 11
  • 17
6
votes
1 answer

perl6 Catching non-fatal exceptions in autovivification

I am running analysis on about 10000 lines of numbers, and some of the lines give me errors: "Use of uninitialized value of type Any in numeric context". I am trying to catch this error to see which lines are causing the problem. However, the…
lisprogtor
  • 5,677
  • 11
  • 17
6
votes
3 answers

How to insert separators between columns?

I have columns in @columns: my @columns =('column1', 'column2', 'column3'); and I have separators in @separators: my @separators = (',', '|'); I want to insert the separators between columns, one by one: column1,column2|column my solution…
chenyf
  • 5,048
  • 1
  • 12
  • 35
6
votes
1 answer

How to open a file handle on a string in Perl 6?

In Perl 5, I can open a filehandle on string like this: open my $kfh, "<", \$message->payload; I have a scenario that uses string as a filehandle and passes it to the open method: my $fh = new IO::Zlib; open my $kfh, "<",…
chenyf
  • 5,048
  • 1
  • 12
  • 35