Raku | |
Logo Size: | 250px |
Logo Alt: | Camelia, the Raku mascot |
Logo Caption: | Camelia, the Raku mascot |
Paradigm: | Multi-paradigm |
Family: | Perl |
Designer: | Larry Wall |
Developer: | Raku community |
Latest Release Version: | 6.d 'Diwali'[1] |
Typing: | Dynamic, gradual |
Implementations: | Rakudo |
Influenced By: | Perl, Ruby, Smalltalk, Haskell,[2] JavaScript |
Influenced: | Perl,[3] Haskell, AntLang |
Operating System: | Cross-platform |
License: | GNU General Public or Artistic 2 |
File Extensions: | .raku, .rakumod, .rakudoc, .t, .rakutest[4] |
Raku is a member of the Perl family of programming languages.[5] Formerly named Perl 6, it was renamed in October 2019.[6] [7] Raku introduces elements of many modern and historical languages. Compatibility with Perl was not a goal, though a compatibility mode is part of the specification. The design process for Raku began in 2000.
The Raku design process was first announced on 19 July 2000, on the fourth day of that year's Perl Conference,[8] by Larry Wall in his State of the Onion 2000 talk.[9] At that time, the primary goals were to remove "historical warts" from the language; "easy things should stay easy, hard things should get easier, and impossible things should get hard"; and a general cleanup of the internal design and application programming interfaces (APIs). The process began with a series of Request for Comments (RFCs). This process was open to all contributors, and left no aspect of the language closed to change.[10]
Once the RFC process was complete, Wall reviewed and classified each of the 361 requests received. He then began the process of writing several "Apocalypses", using the original meaning of the term, "revealing".[11] While the original goal was to write one Apocalypse for each chapter of Programming Perl, it became obvious that, as each Apocalypse was written, previous Apocalypses were being invalidated by later changes. For this reason, a set of Synopses was published, each one relating the contents of an Apocalypse, but with any subsequent changes reflected in updates. Today, the Raku specification is managed through the "roast" testing suite,[12] while the Synopses are kept as a historical reference.[13]
There is also a series of Exegeses written by Damian Conway that explain the content of each Apocalypse in terms of practical usage. Each Exegesis consists of code examples along with a discussion of the usage and implications of the examples.[14]
There are three primary methods of communication used in the development of Raku today. The first is the Raku Internet Relay Chat (IRC) channel on Libera Chat. The second is a set of mailing lists.[15] The third is the Git source code repository hosted at GitHub.[16]
The major goal Wall suggested in his initial speech was the removal of historical warts. These included the confusion surrounding sigil usage for containers, the ambiguity between the select
functions, and the syntactic impact of bareword filehandles. There were many other problems that Perl programmers had discussed fixing for years, and these were explicitly addressed by Wall in his speech.
An implication of these goals was that Perl 6 would not have backward compatibility with the existing Perl codebase. This meant that some code which was correctly interpreted by a Perl 5 compiler would not be accepted by a Perl 6 compiler. Since backward compatibility is a common goal when enhancing software, the breaking changes in Perl 6 had to be stated explicitly. The distinction between Perl 5 and Perl 6 became so large that eventually Perl 6 was renamed Raku.
The language's mascot is "Camelia, the Raku bug".[17] Her name is a nod to the camel mascot associated with Perl, and her form, in the pun-loving tradition of the Perl community, is a play on "software bug". Spiral designs embedded in her butterfly-like wings resemble the characters "P6", the favored nickname for Perl 6, and off-center eye placement is an intentional pun on "Wall-eyed".[18]
One of the goals behind the lively and colorful design of the logo was to discourage misogyny in the community and for it to be an opportunity for those of "masculine persuasion" to show their sensitive side.[19]
, only the Rakudo implementation is under active development. No implementation will be designated as the official Raku implementation; rather, "Raku is anything that passes the official test suite."[20]
Rakudo Perl 6[21] [22] targets a number of virtual machines, such as MoarVM, the Java Virtual Machine, and JavaScript. MoarVM is a virtual machine built especially for Rakudo[23] and the NQP Compiler Toolchain.[24] There is a layer between Raku and the virtual machines named Not Quite Perl 6 (NQP), which implements Raku rules for parsing Raku, and an abstract syntax tree and backend-specific code generation. Large portions of Rakudo are written in Raku, or in its subset NQP. Rakudo is not a completely self-hosting implementation, nor are there concrete plans at this point to make Rakudo a bootstrapping compiler.
Pugs was an initial implementation of Perl 6 written in Haskell, led by Audrey Tang. Pugs used to be the most advanced implementation of Perl 6, but since mid 2007, it is mostly dormant (with updates made only to track the current version of the Glasgow Haskell Compiler (GHC)). As of November 2014, Pugs was not being maintained.[25]
In 2007, v6-MiniPerl6 ("mp6") and its reimplementation, v6-KindaPerl6 ("kp6") were written as a means to bootstrap the Perl-6.0.0 STD, using Perl 5. The STD is a full grammar for Perl 6 and is written in Perl 6. In theory, anything capable of parsing the STD and generating executable code is a suitable bootstrapping system for Perl 6. kp6 is currently compiled by mp6 and can work with multiple backends.[26] [27] mp6 and kp6 are not full Perl 6 implementations and are designed only to implement the minimum featureset required to bootstrap a full Perl 6 compiler.
Yapsi was a Perl 6 compiler and runtime written in Perl 6. As a result, it required an existing Perl 6 interpreter, such as one of the Rakudo Star releases, to run.[28]
Niecza, another major Perl 6 implementation effort, focused on optimization and efficient implementation research. It targets the Common Language Infrastructure.[29]
The Raku specification requests that modules be identified by name, version, and authority.[30] It is possible to load only a specific version of a module, or even two modules of the same name that differ in version or authority. As a convenience, aliasing to a short name is provided.
CPAN, the Perl module distribution system, does not yet handle Raku modules. Instead a prototype module system is in use.[31]
Also, a book dedicated to one of the first Perl 6 virtual machines, Parrot, was published in 2009.