Questions tagged [rakudo]

Rakudo is a Perl 6 compiler running on the MoarVM virtual machine.

5
votes
1answer
57 views

“Can't open perl script ”t/spec/fudgeall“: File or directory not found”

I am trying to run some tests for Rakudo following instructions in the README.md, that is, with perl Configure.pl and make. However, when I run make t/02-rakudo/09-thread-id-after-await.t after ...
6
votes
2answers
97 views

Multiply all values in a %hash and return a %hash with the same structure

I have some JSON stored in a database column that looks like this: pokeapi=# SELECT height FROM pokeapi_pokedex WHERE species = 'Ninetales'; -[ RECORD 1 ]------------------------------------------ ...
8
votes
1answer
386 views

Weight the 'randomness' of the 'pick' routine?

I'm creating an API server in Perl 6, using the Cro framework! The purpose of this API is to serve data about Pokemon, and provide endpoints for generating Pokemon based on input data. One of the ...
6
votes
1answer
128 views

Perl6 (Rakudo) - How to handle special characters from file?

How can I read special characters from a external file ? Here a simple .txt file in French, which content is the first paragraph of https://fr.lipsum.com/ : as you can see on my screenshot, the file ...
6
votes
1answer
64 views

`Missing or wrong version of dependency` after recompiling nqp

I am trying to learn myself how to debug rakudo and nqp. So this is my first attempt: cd $HOME/debug git clone https://github.com/rakudo/rakudo.git cd rakudo perl Configure.pl --gen-moar --gen-nqp --...
4
votes
1answer
100 views

Obtaining the QAST of a Perl 6 file from another program

This is related to this question on accesing the POD, but it goes further than that. You can easily access the Abstract Syntax Tree of a Perl 6 program using: perl6 --target=ast -e '"Þor is mighty!"....
3
votes
0answers
88 views

Can't precompile when using some external module

I'm trying to precompile external files to get their assets with this script: #!/usr/bin/env perl6 use v6; use nqp; my $precomp-store = CompUnit::PrecompilationStore::File.new(prefix => "/tmp"....
6
votes
1answer
95 views

Perl 6: maxpairs warns about stringification of undefined values

It looks like maxpairs doesn't like to be called on a list with undefined values: > my @foo; @foo[2] = 4; say @foo.maxpairs; Use of uninitialized value of type Any in string context. Methods .^...
6
votes
1answer
89 views

How to disable Perl 6 REPL creating .precomp

Every time I run perl6 to enter the REPL mode, it creates a .precomp directory, which also slows down the appearance of the prompt. If the .precomp directory already exists, the prompt appears almost ...
6
votes
1answer
84 views

Where is “require” defined?

I have been looking in Rakudo source for the implementation of require, first out of curiosity and second because I wanted to know if it was returning something. I looked up sub require and it ...
7
votes
0answers
154 views

Recursive subroutine

Let's say I have a pool of packages a, b, c,... each package has name, version and dependencies. In below code, get-cand sub takes a package and returns the candidates from the pool (along with ...
11
votes
1answer
134 views

Are typed signatures for stubbed methods not enforced in roles for Perl6?

I am trying to do some OOP with Perl6 and am having a little trouble with roles. I am trying to use them in a similar way to a Java interface, where I would just have method signatures that must be ...
16
votes
1answer
340 views

How can you call JavaScript builtins from Perl 6 with the new JS backend?

I know it is possible to invoke Java when Perl 6 is using that backend: How do I invoke a Java method from perl6 Is there a way yet to access e.g. the JavaScript DOM interface from Perl 6 with the ...
16
votes
1answer
402 views

Why are the source file names not human readable?

I installed Perl6 with rakudobrew and wanded to browse the installed files to see a list of hex-filenames in ~/.rakudobrew/moar-2018.08/install/share/perl6/site/sources as well as ~/.rakudobrew/moar-...
10
votes
3answers
409 views

Is it possible for Perl 6 to work online?

This is probably a naïve and even not a valid question... I've made a Perl 6 program (and hope to make a couple others) which analyzes local data taking into account some user-defined parameters. ...
6
votes
3answers
139 views

Why Rakudo Star for Windows still compiled/linked for exact FS location (c:\rakudo)?

And what should be done so Rakudo (Star) does not depend on the location in filesystem?
14
votes
3answers
396 views

Is it possible to compile/install Perl6 on a Raspberry Pi 3?

I am trying to install Rakudo Star 2018.04 on a Raspberry Pi 3. I do: sudo perl Configure.pl --gen-moar --gen-nqp --prefix ~/rakudo and it completes successfully. And then I try: sudo make-...
5
votes
2answers
143 views

Where is Rakudo x86 32-bit precompiled installer/binaries?

I would like to write my program using Perl6/Rakudo and it must run on both 32-bit and 64-bit OSes (Windows and Linux). But 32-bit Rakudo installer will not released any more. What is the best I can ...
7
votes
1answer
120 views

Debugging into function calls

I want to know if, in this code, sub might-sink { return [1,2,Failure.new("boo!"),"still here"]; } might-sink; say might-sink; the first call to might-sink in sink context actually calls List....
0
votes
2answers
178 views

Perl6 Rakudo Star: Why does it take so long to install?

I'm not trying to hate on Perl 6, but I'm wondering why the installation takes so long, in comparison to say Common Lisp. Thanks in advance. -comborico1611 20th of April, 2018 Edit: On my laptop ...
6
votes
1answer
122 views

How can I interact with the Github API using Perl6?

I want to use the Github API in a script and I want to use it as an experience to get better using Perl6. However, I cannot even get a simple proof of concept to work. Through some testing I realized ...
8
votes
3answers
149 views

Succinct way to change thrown Exception to Failure?

Is there a more succinct way to lift a thrown Exception to a Failure than the following? try { die 'always'; CATCH { default { fail $_ } } }
9
votes
2answers
182 views

How to return a value from a block's CATCH phaser?

What is the syntax to return a value from a CATCH phaser from a block which is not a Routine? sub foo() { <1 2 3>.map: -> $a { die 'oops'; CATCH { default { 'foo' } } ...
3
votes
1answer
79 views

Rakudo Perl 6: clear screen while using Readline module

Here's my test program: use Readline; shell 'clear'; my $r = Readline.new; loop { my $a = $r.readline("> "); {say ''; last} if not defined $a; $r.add-history( $a ); say $a; } After I ...
3
votes
2answers
409 views

Cannot install Readline with Rakudo Perl 6 zef

I'm trying to install Readline. (The system is Linux Mint Mate 18.3, the same is true for Lubuntu 17.10). $ zef install Readline The installation process begins but later is aborted with the ...
3
votes
2answers
280 views

Batch text processing with Perl 6

I am reading Think Perl 6 by Laurent Rosenfeld, with Allen B. Downey recently which is a very good reading. It has its .tex files available in github here. It has code examples like this: I ...
6
votes
2answers
226 views

Installation of modules Perl 6 failed - No compiler available for Perl v6.c

I installed Rakudo, the Perl 6 interpreter, by: sudo apt-get install rakudo I am following a tutorial about installation of Perl 6 modules: http://perl6maven.com/how-to-install-perl6-modules And ...
2
votes
2answers
92 views

How can one assign an item contextualized Array to a positional?

In Rakudo Perl 6 item or $ can be used to evaluate an expression in item context. See https://docs.perl6.org/routine/item I am using a library that returns an item contextualized Array. What is the ...
5
votes
1answer
150 views

Can I limit my Perl 6 program to running under a particular implementation?

The dd routine is a Rakudo-specific feature, but that's incidental to my question. Is there a way inside a program to check the implementation and bail out if it's not the right one? Do I have to do ...
6
votes
2answers
152 views

How to be aware of missing values during multi-value iteration in Perl 6?

During multi-value iteration, if we run out of values, the last group of values will not be handled in the current version of Rakudo. my @arr = 1, 2, 3, 4, 5, 6 for @arr -> $a, $b, $c, $d { say $...
4
votes
1answer
179 views

How do I change the size of an array in Perl6 after creation?

In perl6 I can create an array of fixed size as so: my @array[5]; How can I then change the size of the array later on to be larger, for instance I want array to be of size 7 now Thanks
3
votes
3answers
162 views

perl6 rakudo 2016.11 match tries to assign to read-only variable, why not in 2016.07?

I have the following method in an action class that worked well in Rakudo 2016.07, but I just installed 2016.11 and now the new Rakudo says my method tries to assign to read-only varible, and I just ...
8
votes
1answer
200 views

Perl 6 reports “Cannot unbox a type object” when typing an array

I suspect this may be a bug in Rakudo, but I just started playing with Perl 6 today, so there's a good chance I'm just making a mistake. In this simple program, declaring a typed array inside a sub ...
1
vote
2answers
91 views

Why does panda fail to install my module when all tests pass locally?

I'm the author of Pod-Perl5 a Perl 6 module that parses Perl 5 pod. Until the release of Perl 6.c, this module installed fine with panda install Pod::Perl5. Now it fails with an extensive list of ...
8
votes
2answers
320 views

How do I get a randomly selected hash key in Perl 6?

A quick and hopefully easy question: I need the means to select from among a given set of hash keys at random. The perl6.org documentation on neither rand nor Hash offer many hints. my %a = 1,2,3,4,...
10
votes
1answer
673 views

how do I create a stand-alone executable with perl 6?

The OLD Perl 6 faq said: "Rakudo, a Perl 6 compiler based on Parrot, allows compilation to bytecode, and a small wrapper exists that can pack up a bytecode file and parrot into a single executable." ...
3
votes
2answers
107 views

How do I `say` and `print` into a buffer?

In Perl 6 the Str type is immutable, so it seems reasonable to use a mutable buffer instead of concatenating a lot of strings. Next, I like being able to use the same API regardless if my function is ...
8
votes
3answers
1k views

How do I invoke a Java method from perl6

use java::util::zip::CRC32:from<java>; my $crc = CRC32.new(); for 'Hello, Java'.encode('utf-8') { $crc.'method/update/(B)V'($_); } say $crc.getValue(); sadly, this does not work Method '...
2
votes
1answer
163 views

Does Parrot have a multi-threaded parallel garbage collector?

My question is about the garbage collector in the Parrot Virtual Machine ( http://www.parrot.org ). Is it multi-threaded?
8
votes
2answers
2k views

How do I read from STDIN in Rakudo Perl6?

As simple as that, how can I read input from STDIN in Perl6? I reckon there's many ways of doing it, but I'm interested in the most idiomatic Perl6 solution.
8
votes
1answer
199 views

Strange behavior of Buf.subbuf in Perl 6

Today I installed Rakudo Star 2012.07 and tryed to write a simple Perl 6 script: #!/usr/bin/env perl6 use v6; use LWP::Simple; my $html = LWP::Simple.get('http://perl6.org'); say $html; It doesn't ...
13
votes
2answers
1k views

How can I use Perl 5 modules from Perl 6?

Is the a way to use Perl 5 modules from CPAN from Rakudo Perl 6? For example, how can I use the venerable Perl 5 module, CGI, which hasn't been ported yet, in Perl 6. Update: And what this funky ...
4
votes
2answers
185 views

Rakudo test suite progression?

There used to be a graph that tracked the implementation of Perl6 against the test suite for Perl6. I was interested in watching it progress (and, regress). What happened to that graph, it used to be ...
-1
votes
1answer
143 views

Does a Perl 6 module for rakudo exist to parse MIMEs? [closed]

I searched github and modules.perl6.org but did not find a module to parse emails. If there is no perl6 module yet a parrot module would be fine too.
1
vote
3answers
208 views

perl6/rakudo: dereferencing-question

#!perl6 use v6; my $list = 'a' .. 'f'; sub my_function( $list ) { for ^$list.elems -> $e { $list[$e].say; } } my_function( $list ); First I tried this in perl5-style, but it ...
13
votes
3answers
1k views

How to execute an external command and capture its output in perl6?

How can I execute an external command and capture its output in Perl6? Perl5-style back-ticks don't seem to work: > my $results = `ls`; Confused at line 1, near "my $results" Synopsis 16 ...
14
votes
4answers
714 views

Does Perl6 support something equivalent to Perl5's __DATA__ and __END__ sections?

Does perl6/Rakudo have something equivalent to perl5's __DATA__ or __END__ sections?
8
votes
2answers
335 views

Rakudo (Perl6): What doesn't yet work?

Rakudo: Is there a place where all the features that don't yet work are listed?
6
votes
1answer
631 views

Sockets code in Rakudo Perl

I've been trying to run some sockets code in Rakudo Perl (freshly built from the repository at http://github.com/rakudo/rakudo) but the implementation of IO::Socket::INET appears to be incomplete. ...
0
votes
1answer
165 views

How to load parrot SDL pir module in rakudo?

I don't know how to load de parrot SDL module in rakudo. I've found a example to do that with pir code. But... there is any way to load pir SDL module into rakudo with perl code?