Chapter 2 of 9
Five documented borrowings outside the Perl family
N.B. This material was collected and structured automatically, and may contain unintentional mistakes. Every claim links its source: please check it before relying on a detail.
Outside the Perl family, five features have a record that names Perl 6 as their source. Swift's rule for indented multi-line strings shipped exactly as Perl 6 designed it. The table lists all five; the sections below tell each story.
| Adoption | Perl 6 / Raku dates | Adopter's dates | What the record says | Verdict |
|---|---|---|---|---|
| Swift multi-line string literals (SE-0168) | RFC 162 (27 Aug 2000); A2 (3 May 2001); Pugs 6.2.7 (13 Jun 2005); Rakudo 2012.11 | swift-evolution 25 Apr and 5 May 2016; accepted 19 Apr 2017; Swift 4.0 | Becca Royal-Gordon cites Perl 6's delimiter-indentation rule and lead author John Holdsworth adopts it; both are SE-0168 authors, but the proposal and the acceptance state the rule without credit (0157381; 0166462; SE-01683; Accepted4) | Borrowed (documented in the design thread); shipped intact, credited in the thread rather than the proposal |
Ruby ->(x) { } lambda | RFC 173 multi-variable for (29 Aug 2000); A4 pointy blocks (15 Jan 2002); Pugs 6.0.7 (18 Feb 2005) | Matz's diary 1 and 22 Jul 2005; commit 27 Jul 2005; ruby-dev:26650, 29 Jul 2005; Ruby 1.9.0, 25 Dec 2007 | Diary says the -> proposal comes from Perl 6; commit labels the new syntax a Perl6-style lambda; ruby-dev:26650 says the grammar is aligned with Perl 6; Matz confirms the origin in 2008 (diary 22 Jul5; commit 759a63b66; ruby-dev:266507; ruby-core:167348; Ruby 1.9.0) | Borrowed (documented), syntax only |
PHP string ++/-- | Raku's current string-increment semantics | RFC 21 Nov 2022; vote 25–0, 28 Jun–12 Jul 2023; implemented in PHP 8.3 | RFC compares PHP with Raku, calls Raku's result consistent, and says its proposal follows Raku's behaviour (PHP RFC9) | Borrowed (documented) |
Swift Regex / RegexBuilder | A5 (4 Jun 2002): rules as grammar methods, /x by default; LTM ≤ Apr 2006; Rakudo NFA-driven LTM 2011.11 | Ilseman gist 10 Jan 2018; forum posts Sep–Oct 2021; SE-0350/0351/0354/0355 in Swift 5.7 (2022) | Gist lists Perl 6 regex features Swift should take outright; 2021 post says the earlier literal design was heavily Raku-inspired; accepted proposals cite PEGs, PCRE2 and Perl 5 only (gist10; forum #4611; SE-035512) | Borrowed at design stage (documented); shipped syntax is not Raku's |
| Joose (JavaScript) via Moose | A12 (16 Apr 2004); Pugs-era Perl 6 meta-model (2005–06) | Moose 0.01, 15 Mar 2006; Joose manual, © 2008–2009 | Moose says it is built on Stevan Little's Perl 6 meta-model prototypes; Joose says it is based largely on Moose (Moose 0.1813; Joose manual14) | Borrowed via Perl 5 (documented, two hops) |
What the sources say 14
Becca (then Brent) Royal-Gordon, later an SE-0168 co-author swift-evolution mailing list, thread "multi-line string literals.", message 015738 source ↗
Recalls that Perl 6's redesign took a heredoc's base indentation from the indentation of its delimiter, and asks whether Swift should treat multi-line literals the same way.
John Holdsworth, later SE-0168's lead author swift-evolution mailing list, thread "multi-line string literals.", message 016646 source ↗
Proposes that the lexer strip each line's margin by the whitespace that precedes the closing quote, explicitly as Perl 6 does.
John Holdsworth, Becca Royal-Gordon and Tyler Cloutier, authors; Joe Groff, review manager Swift Evolution proposal SE-0168, Multi-Line String Literals source ↗
Specifies triple-quoted multi-line strings whose lines all lose the indentation found ahead of the closing delimiter; the text never mentions Perl or Perl 6.
Joe Groff, review manager, for the Swift core team Swift Forums, SE-0168 acceptance announcement source ↗
Accepts the proposal with revisions: where the closing delimiter sits fixes the indentation for the whole literal, and under-indented or inconsistently indented lines are errors. Perl goes unmentioned.
Yukihiro Matsumoto (Matz), Ruby's creator Matz's diary on rubyist.net, entry on the new lambda grammar (Japanese) source ↗
Traces the original arrow-lambda proposal to Perl 6, explains Perl 6's pointy-block closures and loops, calls Perl 6 culturally close to Ruby, yet doubts when or whether it will be used.
Yukihiro Matsumoto (Matz), Ruby's creator ruby/ruby commit 759a63b6 (parse.y and ChangeLog) source ↗
Adds an arrow lambda expression to Ruby's parser and records it in the ChangeLog as a Perl6-style lambda, flagged as new and very experimental.
Yukihiro Matsumoto (Matz), Ruby's creator ruby-dev mailing list, message 26650 (Japanese), thread on Ruby 2.0 block-parameter notation source ↗
Replying to Shin-ichiro Hara, who wanted parameters listed within the braces, Matz says the present grammar follows Perl 6, sets the Perl6/Ruby2 arrow form beside Groovy's and Haskell's, and offers to reconsider.
Yukihiro Matsumoto (Matz), Ruby's creator ruby-core mailing list, message 16734, thread "lambda, ->, haskell, and so on" source ↗
Answering Evan Phoenix, Matz confirms Perl 6 has the arrow syntax and is its source, and says he once tried an arrow block form for method calls but dropped it as too radical.
George Peter Banyard, the RFC's author PHP RFC: Path to Saner Increment/Decrement operators source ↗
Sets PHP's string increment beside Raku's, describing Raku as a Perl successor whose result is consistent, and states that the proposed PHP behaviour follows Raku's.
Michael Ilseman, Apple engineer leading Swift's String and standard-library work GitHub gist "State of String: ABI, Performance, Ergonomics, and You!" source ↗
Sets Swift the aim of surpassing Perl at string processing, cites Apocalypse 5, and lists Perl 6 regex features Swift should take outright, from free-form syntax and named captures to interpolation, plus ratcheting and LTM.
Michael Ilseman, lead designer of Swift's string processing Swift Forums, "Declarative String Processing Overview", post #46 source ↗
Says the earlier literal design drew heavily on Raku, but familiar, conventional regex syntax mattered most for literals, so the team's novelty budget goes to Pattern, though he prefers Raku's syntax himself.
Hamish Knight and Michael Ilseman, authors Swift Evolution proposal SE-0355, Regex Syntax and Run-time Construction source ↗
Defines the regex syntax Swift accepts in literals and strings as a blend of PCRE 2, Oniguruma, ICU and .NET, compares behaviour with Perl in places, and never mentions Raku or Perl 6.
Stevan Little, Moose's author Moose 0.18 documentation (Moose.pm POD) on CPAN source ↗
States that Moose grew out of the experimental prototypes Little built for Perl 6's meta-model, while stressing that Moose itself is meant for real use rather than as an experiment.
Nickolay Platonov, Joose author Joose.Manual, Joose 3.013 documentation on openjsan.org (Wayback copy of 8 Feb 2024; the live URL now serves an unrelated page) source ↗
Presents Joose as a complete JavaScript object system modelled largely on Moose, which it credits with borrowing much from Perl 6's object model as well as from CLOS and Smalltalk.
Swift's multi-line strings
Here a Perl 6 design decision shipped whole in a major language outside the Perl family. The credit is in the discussion rather than in the proposal.
| Date | What happened |
|---|---|
| 23 April 2016 | Becca Royal-Gordon, then posting as Brent, mentions her background on swift-evolution: she helped design Perl 6 and was a Parrot pumpking (forum #2115) |
| 25 April 2016 | In the thread on multi-line string literals, Royal-Gordon describes Perl 6's choice: a heredoc's base indentation comes from its delimiter. She asks whether Swift should do the same (0157381) |
| 5 May 2016 | John Holdsworth replies that the lexer could strip the margin by the whitespace before the closing quote, "as per Perl6" (0166462) |
| April 2017 | Holdsworth, Royal-Gordon and Tyler Cloutier are SE-0168's authors. The proposal says whitespace in front of the closing delimiter is removed from every line, without naming a source (SE-01683) |
| 8 April 2017 | In the review, Royal-Gordon sums up Perl 6's heredocs as Perl 5's plus de-indenting (review #1716) |
| 19 April 2017 | Joe Groff accepts the proposal: the closing delimiter's position sets the indentation of the whole literal. Swift makes under-indentation an error, where Raku warns (Accepted4) |
What the sources say 2
Becca (then Brent) Royal-Gordon, later an SE-0168 co-author swift-evolution thread on multi-line string literals, imported to Swift Forums under the title "Optional dictionary subscripts", post #21 source ↗
Arguing against copying Perl 5's quoting rules into Swift, Royal-Gordon recounts helping design Perl 6, serving as pumpking for a subsystem of Parrot, and contributing patches to Perl 5 itself.
Becca (then Brent) Royal-Gordon, SE-0168 co-author Swift Forums, SE-0168 review thread, post #17 source ↗
Surveying prior art during the review, Royal-Gordon describes Perl 6's quoting as Perl 5's arbitrary delimiters and heredocs with de-indentation and user-defined quoting added, noting that Perl 5 lacks de-indenting.
The rule reached Swift 4.0 unchanged. As with Swift's regex work, Perl 6 is credited in the discussion.
Ruby's -> arrow
This is the best-documented case. Ruby took the arrow syntax from Perl 6, and gave it its own meaning.
| Date | What happened |
|---|---|
| 1 July 2005 | Matz's diary lists a Perl6-style anonymous function among candidate lambda syntaxes (diary 1 Jul17) |
| 22 July 2005 | The diary says the -> proposal came from Perl 6. Matz calls Perl 6 culturally close to Ruby, and wonders when, or whether, it will be widely used (diary 22 Jul5) |
| 27 July 2005 | Matz commits it as new and very experimental. That is five months after Pugs made pointy blocks runnable, and three and a half years after A4 specified them. |
| 29 July 2005 | Matz tells ruby-dev the grammar is aligned with Perl 6. His comparison table sets Perl6/Ruby2 -> (x,y) {...} beside Groovy's and Haskell's forms (ruby-dev:266507) |
| 12 May 2008 | On ruby-core, Evan Phoenix quotes Matz's earlier remark that sharing a syntax with Perl 6 would quickly win mind-share, and asks whether Perl 6 has -> (ruby-core:1673318) |
| 12 May 2008 | Matz answers "Yes. It's the origin." He adds that Perl 6 goes further, with for obj -> var { }, and that he once tried a method(arg) -> x { } block form himself (ruby-core:167348) |
| 14 May 2008 | Answering an objection, Matz says Perl 6 has good ideas worth taking (ruby-core:1676619) |
What the sources say 3
Yukihiro Matsumoto (Matz), Ruby's creator Matz's diary on rubyist.net (Japanese) source ↗
Listing candidate lambda notations, Matz sketches a Perl6-style anonymous function with the arrow before its parameters and judges Perl 6's arrow an acceptable shorter alternative to a lambda keyword, alongside Haskell's backslash.
Evan Phoenix, Rubinius lead developer, quoting Matz ruby-core mailing list, message 16733, thread "lambda, ->, haskell, and so on" source ↗
Evan Phoenix quotes Matz saying he is content with the current arrow and that sharing it with Perl 6 would quickly win mind-share, then asks whether Perl 6 actually has that syntax.
Yukihiro Matsumoto (Matz), Ruby's creator ruby-core mailing list, message 16766, thread "lambda, ->, haskell, and so on" source ↗
Rejecting David A. Black's objection that the mind-share argument would equally justify Perl's globals, Matz replies that Perl 6 has good ideas worth taking even though its bad parts are very bad.
Ruby's ->(x) { } builds a lambda object. Raku's -> introduces a Block with a signature, which for, given and with consume.
PHP's string increment
PHP's increment RFC, by George Peter Banyard, says in its design text that it follows Raku (PHP RFC9). It is the clearest such statement in a shipped mainstream feature.
- The RFC surveys other languages. It describes Raku as a Perl successor whose string increment gives consistent results, and adopts that behaviour.
- Raku had come up before: a 2013 internals thread on letter decrementing cited S03's decrement, which does not fully mirror increment (6818420).
What the sources say 1
Peter Lind, PHP internals list participant PHP internals list, thread "Allow letter decrementing", message 68184 source ↗
Citing Perl 6's Synopsis 3 in a thread on letter decrementing, Lind notes that Perl 6 can decrement strings, though not as a full mirror image of its increment.
Swift's regex
Swift's team studied Perl 6's regexes and grammars for years, and its 2018 plan drew directly on them. The syntax Swift shipped in 2022 is more conventional, but several of the ideas arrived with it.
The core team's interest
| Date | Who | What they said |
|---|---|---|
| 9 December 2015 | Chris Lattner | Hoped Swift would get real regex support, with Perl 6-style extensions (335/421) |
| 1 February 2016 | Chris Lattner | Urged forum readers to study Perl 6's regexes (876/922) |
| 23 January 2017 | Joe Groff | Pointed to how Perl 6 grew regexes into full grammars (4939/6823) |
| 25 January 2017 | Chris Lattner | Wrote that Swift could learn a lot from Perl 6's grammars (4939/13024) |
| 26 January 2017 | Dave Abrahams | Pointed to the parsers Perl 6's recursive grammars allow (4939/15325) |
| 15 March 2020 | Chris Lattner | Praised Perl 6's regex ideas again (34373/1026) |
What the sources say 6
Chris Lattner, Swift's creator, core team Swift Forums (swift-evolution import), "Empower String type with regular expression", post #4 source ↗
Lattner hopes Swift gains proper regex support and argues that first-class language support would allow inline captures, flexible syntax, compile-time checking and Perl 6-style extensions beyond the basic regex model.
Chris Lattner, Swift's creator, core team Swift Forums (swift-evolution import), "Empower String type with regular expression", post #9 source ↗
Lattner urges readers to study Perl 6's regexes, explaining that a community obsessed with regexes got to rebuild them from experience and produced something very powerful.
Joe Groff, Swift core team Swift Forums (swift-evolution import), "Strings in Swift 4", post #68 source ↗
Groff warns against a narrow focus on regexes, says the Perl 6 designers grew regex support into arbitrary grammars, and recommends Swift begin from that level by examining their work.
Chris Lattner, Swift's creator, core team Swift Forums (swift-evolution import), "Strings in Swift 4", post #130 source ↗
Agreeing with Joe Groff, Lattner says Swift has much to gain from Perl 6's grammars and should take its time on them, adding that by regex he means a general grammar system.
Dave Abrahams, Swift core team Swift Forums (swift-evolution import), "Strings in Swift 4", post #153 source ↗
Abrahams explains that regexes cannot parse languages like Swift and that he has in mind parsers of the kind Perl 6's recursive grammars allow, linking examples.
Chris Lattner, Swift's creator, core team Swift Forums, "Regular expressions in Swift", post #10 source ↗
Lattner says Perl 6 has excellent ideas for regex support after long community thought, and that although the language is not widely used, Swift should study and learn from its strengths.
The 2018 plan
Michael Ilseman's January 2018 "State of String" gist set Swift the goal of beating Perl at string processing (gist10). The gist:
- cites Apocalypse 5 as Perl's clean-up of its own regex mess, and notes that Perl 6 has a PEG-like grammar system;
- lists Perl 6 features Swift should take outright: whitespace-insignificant syntax, named captures, multi-line matching and regex interpolation;
- proposes ratcheting, frugal quantifiers and Raku's
%separator quantifier; - asks whether alternation should use longest-token matching.
Choosing familiar syntax
| Date | What happened |
|---|---|
| 1 October 2021 | Ilseman explains the choice. For a literal, familiar traditional syntax mattered most, so the team would spend its appetite for novelty on a separate Pattern type. He personally preferred Raku's syntax (forum #4611) |
| 3 March 2022 | In the first reply to Hamish Knight's regex-syntax pitch, Joe Groff again cites Raku for making /x the default (Swift Forums27) |
| 2022 | SE-0354 makes extended syntax mandatory in multi-line #/…/# literals, and keeps whitespace significant in single-line ones (SE-035428) |
What the sources say 2
Joe Groff, Swift team, replying to Hamish Knight's pitch Swift Forums, Regex Syntax pitch thread, post #2 (the pitch itself is Hamish Knight's) source ↗
Groff backs a PCRE baseline, singles out free-whitespace /x mode as the most valuable tweak, and notes that Raku made it the default for pattern literals, urging new languages to do likewise.
Hamish Knight, Michael Ilseman and David Ewing, authors Swift Evolution proposal SE-0354, Regex Literals source ↗
Enables extended (?x) syntax, with non-semantic whitespace and comments, in multi-line #/…/# literals, and rejects that default for single-line ones for familiarity and compatibility; it cites Perl, never Raku.
What shipped in Swift 5.7 (2022)
A5's choices from 2002 arrived two decades later, in adapted form:
- composable, named sub-patterns, in RegexBuilder (SE-035129);
- PEG-style ordered choice, credited to PEGs (SE-035030);
- mandatory extended syntax in multi-line literals.
What the sources say 2
Richard Wei, Michael Ilseman, Nate Cook and Alejandro Alonso, authors Swift Evolution proposal SE-0351, Regex builder DSL source ↗
Introduces RegexBuilder, a result-builder DSL for assembling regexes from reusable components, including other regexes and custom patterns, without mentioning Perl or Raku.
Michael Ilseman, author Swift Evolution proposal SE-0350, Regex Type and Overview source ↗
Calls Parsing Expression Grammars the nearest formal analogue of Swift's regex design, which uses ordered-choice alternation, possessive quantification and recursive subpattern calls; it never mentions Perl or Raku.
Perl 6 is credited in the gist and the forum posts rather than in the proposals. SE-0363 defines a [raku] reference link that its text does not use (SE-036331).
What the sources say 1
Nate Cook and Alejandro Alonso, authors Swift Evolution proposal SE-0363, Unicode for String Processing source ↗
Compares Swift's grapheme-cluster regex matching with NSString, Java, Ruby and Perl, and lists a reference link to Raku's regex documentation that nothing in the proposal's text uses.
Joose
Joose is a genuine transmission from Perl 6 to JavaScript. It came by way of Perl 5's Moose, which is built on Stevan Little's prototypes of the Perl 6 meta-model (Joose manual14).
Two transmissions below the language level
These two are not language features, but they carry Perl 6 designs into other ecosystems:
| Where | What was taken | The record |
|---|---|---|
Python's third-party regex module | Variable-length lookbehind, done by matching backwards | In 2008 its author, Matthew Barnett, said the idea came from a page on how Perl 6 could implement it. He names no page, but S05 had described after as reversing the syntax tree since at least April 2006. CPython's own re has not taken the module (cpython#4807532; S0533; PyPI regex34) |
| The Rust Grammar Working Group's notation | Raku's % and %% separator modifiers | In 2018 eddyb, then on Rust's language and compiler teams, attributed them to Perl 6. The wg-grammar files use %% throughout; the Rust Reference keeps its own notation (internals #835; expr.lyg36) |
What the sources say 5
Matthew Barnett, author of the third-party regex module python/cpython issue #48075 (migrated from bugs.python.org), comment source ↗
Barnett reports that his re-engine rework adds backward matching so lookbehinds can be variable-width, and credits the idea to a page on implementing it in Perl 6, without naming the page.
Synopsis 5 (Larry Wall, Damian Conway, Patrick Michaud and others), Perl 6 design document S05-regex.pod, Raku/old-design-docs repository source ↗
States that the after assertion performs lookbehind by matching a reversed syntax tree leftward, and forbids lookbehind on any pattern that is not reversible.
Matthew Barnett, the regex module's author PyPI project page for regex source ↗
Describes regex, a separately installed package, as an alternative intended to replace Python's built-in re, compatible with it but adding features, among them lookbehinds able to match strings of varying length.
eddyb (Eduard-Mihai Burtescu), Rust language and compiler team member Rust internals forum, "Proposal: Grammar Working Group", post #8 source ↗
Describing the proposed grammar notation, eddyb lists separator forms for repeated items and says the % syntax comes from Perl 6, as he recalls, having been suggested by eternaleye.
Rust Grammar Working Group (eddyb, Eric Huss, Mazdak Farrokhzad) rust-lang/wg-grammar repository, grammar/expr.lyg source ↗
The working group's expression grammar writes comma-separated lists, among them array elements, tuple fields, call and method arguments and closure parameters, with the %% separator modifier.