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
5
votes
2 answers

How do I generate numbered lists with pod?

Looking at https://docs.raku.org/language/pod#Lists. I don't see a way to create a numbered list: one three four Is there an undocumented way to do it?
StevieD
  • 6,925
  • 2
  • 25
  • 45
5
votes
2 answers

Where does the $*REPO dynamic variable obtain its values, and how to change/alter them?

This question is complementary to figuring out why this error (which started as a zef error) occurs. Apparently, in certain circumstances the repository chain accessible from $*REPO may vary. Namely, in a GitHub action such as this one, where raku…
jjmerelo
  • 22,578
  • 8
  • 40
  • 86
5
votes
1 answer

Should sigilless "variables" with type constraints be re-bindable?

[EDIT: closed in favor of https://stackoverflow.com/questions/69231506/what-are-the-rules-for-re-binding, which I formulated after more clearly understanding what I was trying to ask in this question.] My understanding from Is there a purpose or…
codesections
  • 8,900
  • 16
  • 50
5
votes
2 answers

Raku-native disk space usage

Purpose: Save a program that writes data to disk from vain attempts of writing to a full filesystem; Save bandwidth (don't download if nowhere to store); Save user's and programmer's time and nerves (notify them of the problem instead of having…
uxer
  • 521
  • 3
  • 10
5
votes
2 answers

What counts as an "outer list" for a Slip?

The docs for Slip mention that "A Slip is a List that automatically flattens into an outer List (or other list-like container or iterable)". Based on this definition, this makes perfect sense: dd my @a = 1, |(2, 3); # OUTPUT: «Array @a = [1, 2,…
codesections
  • 8,900
  • 16
  • 50
5
votes
1 answer

raku, library was not found

I was trying to execute this program in Raku but I got an error below: How should I provide raku with the perl library there; what to copy where ? use Math::BigInt; $i = Math::BigInt->new($string); use Math::BigInt ':constant'; print…
user2925716
  • 949
  • 1
  • 6
  • 13
5
votes
2 answers

Is it possible to distribute the code of a class to several files?

Is it possible to distribute the code of a class to several files?
sid_com
  • 24,137
  • 26
  • 96
  • 187
5
votes
1 answer

require Readline - You cannot create an instance of this type (Readline)

When I run this code require Readline; my $rl = Readline.new; my $string = $rl.readline( ':'); $string.say; I get this error-message: You cannot create an instance of this type (Readline) When I use useto load Readline it works. Why does require…
sid_com
  • 24,137
  • 26
  • 96
  • 187
5
votes
2 answers

Allowing a method to operate on a List of my type?

Raku makes it very easy to support existing functions on my new types by implementing [multi?|sub?] methods on my type. However, I'm wondering if it also provides a way to have existing (or new) methods apply to Lists or other positional…
codesections
  • 8,900
  • 16
  • 50
5
votes
3 answers

Is there a straightforward way to check if something is a mixin?

Raku mixins have two (or more) natures, combining several values in the same container, or values along with roles. However, there is not, as far as I can tell, a straightforward way to check for "mixinity" in a variable that has not been created by…
jjmerelo
  • 22,578
  • 8
  • 40
  • 86
5
votes
0 answers

No matching VM found when running Comma IDE on macOS

I installed Comma IDE from this link but when I try to run it by double clicking on the application icon in Finder in the Applications folder I get an error "No matching VM found. Java 1.8 or later is required" I am on macOS Big Sur 11.2. NOTE: I…
Håkon Hægland
  • 39,012
  • 21
  • 81
  • 174
5
votes
2 answers

Strings and Strands in MoarVM

When running Raku code on Rakudo with the MoarVM backend, is there any way to print information about how a given Str is stored in memory from inside the running program? In particular, I am curious whether there's a way to see how many Strands…
codesections
  • 8,900
  • 16
  • 50
5
votes
0 answers

raku: Support for utf8-c8 issue in Raku 2020.10

I have a file from Wild Wild Web and it contains malformed UTF8. I handled malformed UTF8 in my other codes in previous versions of Raku. In 2020.10 version, I am running into this issue below. Has the support for utf8-c8 changed (this page says it…
lisprogtor
  • 5,677
  • 11
  • 17
5
votes
2 answers

(How) does raku do class synonyms?

I have class Length is Measure export { ... } I want synonyms that differ only in that the class name is different, I have tried this: class Distance is Length is export {} class Breadth is Length is export {} class Width is Length is…
librasteve
  • 6,832
  • 8
  • 30
5
votes
2 answers

Best way to check optional module availability

In a module I'm writing there is just one method which requires an additional module, so I wish to make that module optional by not listing it in the depends part of the META6.json file. The method will return a Failure object if the optional module…
Fernando Santagata
  • 1,487
  • 1
  • 8
  • 15