Perl6

1 program Added 2026-02-27T10:00:00Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled Evidence Report issue View issues
Aliases: Perl 6, Raku
Provenance: commit b508641264 · authored 2026-02-27T21:13:59+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

8 sources · pl_id: pl/raku
LLM (this repo) · 1PldbLinguistPygmentsWikipediaHyperpolyglotRosettacodeWikidata · Q2052676

Wikipedia infobox

Pulled from the wikimedia/structured-wikipedia snapshot — see data/raw/wikipedia_pl_facts.*.jsonl and pl_fact.csv for the long-table provenance.

Paradigmsmulti-paradigm
Typingdynamic, gradual
Designed byRaku community · Larry Wall
First appeared2015
Influenced byPerl · Ruby · Smalltalk · Haskell · JavaScript
LicenseGNU General Public or Artistic 2
Homepagehttps://raku.org/

Extensions claimed by this language

34 claims. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.6pllinguistprimary12 files
.plpygmentsprimary5.4M files
.rakuwikidataprimary17.1K files
.rakudocwikidataprimary1.1K files
.rakumodwikidataprimary30.3K files
.rakutestwikidataprimary6.7K files
.twikidataprimary2.7M files
.6plpygmentssecondary12 files
.6pmlinguistsecondary5 files
.6pmpygmentssecondary5 files
.nqplinguistsecondary22.5K files
.nqppygmentssecondary22.5K files
.p6linguistsecondary26.9K files
.p6pygmentssecondary26.9K files
.p6llinguistsecondary2 files
.p6lpygmentssecondary2 files
.p6mlinguistsecondary5 files
.p6mpygmentssecondary5 files
.pllinguistsecondary5.4M files
.pl6linguistsecondary10.5K files
.pl6pygmentssecondary10.5K files
.pmlinguistsecondary10.0M files
.pmpygmentssecondary10.0M files
.pm6linguistsecondary132.1K files
.pm6pygmentssecondary132.1K files
.rakulinguistsecondary17.1K files
.rakupygmentssecondary17.1K files
.rakudocpygmentssecondary1.1K files
.rakumodlinguistsecondary30.3K files
.rakumodpygmentssecondary30.3K files
.rakutestpygmentssecondary6.7K files
.tlinguistsecondary2.7M files
.tpygmentssecondary2.7M files
.nqpwikipediaproposed22.5K files

Related languages

Perl 6 (0.81)Raku (0.50)Perl (0.25)XS (0.15)Perlito (0.15)

LLM-contributed programs

Hailstone Sequence

Provenance: commit b508641264 · authored 2026-02-27T21:13:59+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
code.raku · added: 2026-02-27T10:00:00Z
use v6;

=begin pod

=TITLE Hailstone sequence

=AUTHOR TimToady

The Hailstone sequence of numbers can be generated from a starting positive
integer, n by:

* If n is 1 then the sequence ends.
* If n is even then the next n of the sequence = n/2
* If n is odd then the next n of the sequence = (3 * n) + 1

The (unproven), Collatz conjecture is that the hailstone sequence for any
starting number always terminates.

=head1 Task

Create a routine to generate the hailstone sequence for a number.

Use the routine to show that the hailstone sequence for the number 27 has 112
elements starting with 27, 82, 41, 124 and ending with 8, 4, 2, 1

Show the number less than 100,000 which has the longest hailstone sequence
together with that sequence's length.

(But don't show the actual sequence)!

=head1 More

U<http://rosettacode.org/wiki/Hailstone_sequence#Raku>


=end pod

sub hailstone($n) { $n, { $_ %% 2 ?? $_ div 2 !! $_ * 3 + 1 } ... 1 }

my @h = hailstone(27);
say "Length of hailstone(27) = {+@h}";
say ~@h;

my $m max= +hailstone($_) => $_ for 1..99_999;
say "Max length $m.key() was found for hailstone($m.value()) for numbers < 100_000";


# vim: expandtab shiftwidth=4 ft=perl6

Real programs from Software Heritage

No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)

Disambiguation rules

Linguist heuristic rules that predict this language when one of its claimed extensions is shared with another.
RuleExtKindPredicates (truncated)
h/linguist/.pl/2.plpredicates[{"kind": "any", "regexes": ["^\\s*(?:use\\s+v6\\b|\\bmodule\\b|\\b(?:my\\s+)?class\\b)"]}]
h/linguist/.pm/1.pmpredicates[{"kind": "any", "regexes": ["^\\s*(?:use\\s+v6\\b|\\bmodule\\b|\\b(?:my\\s+)?class\\b)"]}]
h/linguist/.t/1.tpredicates[{"kind": "any", "regexes": ["^\\s*(?:use\\s+v6\\b|\\bmodule\\b|\\bmy\\s+class\\b)"]}]

Contribute — propose a file extension

Tell us where to find evidence about Perl6 (mapped to pl/raku). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Perl6/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← Perl module Perligata →