# Raku (programming language)

Raku is a member of the Perl family of programming languages. Formerly named Perl 6, it was renamed in October 2019. 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.

## History

   In Perl 6, we decided it would be better to fix the language than fix the user.
The Raku design process was first announced on 19 July 2000, on the fourth day of that year's Perl Conference, by Larry Wall in his State of the Onion 2000 talk. 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.
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". 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, while the Synopses are kept as a historical reference.
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.
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. The third is the Git source code repository hosted at GitHub.

### Initial goals and implications

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.

### Mascot

The language's mascot is "Camelia, the Raku bug". 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".
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.

## Implementations

As of 2017, 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."
Rakudo Perl 6 targets a number of virtual machines, such as MoarVM, the Java Virtual Machine, and JavaScript. MoarVM is a virtual machine built especially for Rakudo and the NQP Compiler Toolchain. 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.

### Historical implementations

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.
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. 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.
Niecza, another major Perl 6 implementation effort, focused on optimization and efficient implementation research. It targets the Common Language Infrastructure.

## Module system

The Raku specification requests that modules be identified by name, version, and authority. 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.

## Books
### Books published before Perl 6 version 1.0 (known as version 6.c)

* Randal, Allison; Sugalski, Dan; Tötsch, Leopold (2003). Perl 6 Essentials (1st ed.). O'Reilly Media. ISBN 978-0-596-00499-6.
* Randal, Allison; Sugalski, Dan; Tötsch, Leopold (2004). Perl 6 and Parrot Essentials (2nd ed.). O'Reilly Media. ISBN 978-0-596-00737-9.
* Walters, Scott (15 December 2004). Perl 6 Now: The Core Ideas Illustrated with Perl 5. Expert's Voice in Open Source. ISBN 978-1-59059-395-0.
Also, a book dedicated to one of the first Perl 6 virtual machines, Parrot, was published in 2009.
* Randal, Allison; Whitworth, Andrew (15 June 2009). Parrot Developer's Guide: Pir. Onyx Neon Press. ISBN 978-0-9779201-2-9.

### Books published after Perl 6 version 1.0 (known as version 6.c)

* Shitov, Andrew (2017). Perl 6 at a Glance. Amazon Digital Services LLC - Kdp. ISBN 978-90-821568-3-6.
* Rosenfeld, Laurent; Downey, Allen B. (2017). Think Perl 6. O'Reilly Media. ISBN 978-1-4919-8055-2.
* Merelo, J. J. (9 July 2017). Learning to program with Perl 6: First Steps: Getting into programming without leaving the command line. Learning to Program with Perl. ISBN 978-1-5217-9578-1.
* Lenz, Moritz (27 July 2017). Perl 6 Fundamentals. Apress. ISBN 978-1-4842-2898-2.
* Shitov, Andrew (7 September 2017). Perl 6 Deep Dive. Packt Publishing, Limited. ISBN 978-1-78728-204-9.
* Shitov, Andrew (2017). Using Perl 6. ISBN 978-90-821568-1-2.
* Szabo, Gabor (3 December 2017). Web Application Development in Perl 6. Author.
* Lenz, Moritz (4 December 2017). Parsing with Perl 6 Regexes and Grammars: A Recursive Descent into Parsing. Apress. ISBN 978-1-4842-3228-6.
* Foy, Brian D. (2018). Learning Perl 6. O'Reilly Media. ISBN 978-1-4919-7768-2.

### Books published with the new Raku name

* Shitov, Andrew (13 October 2019). Using Raku: 100 Programming Challenges Solved in the Raku Programming Language (2nd ed.). Suzi K Edwards. ISBN 978-90-821568-8-1.
* Shitov, Andrew (18 October 2019). Raku One-Liners: Getting the Most of Raku's Expressive Syntax for Your Daily Routines. Amazon Digital Services LLC - Kdp. ISBN 978-90-821568-9-8.
* Lenz, Moritz (6 September 2020). Raku Fundamentals: A Primer with Examples, Projects, and Case Studies. Apress. doi:10.1007/978-1-4842-6109-5. ISBN 978-1-4842-6108-8.