Raku (programming language)

Last updated
Raku
Camelia.svg
Camelia, the Raku mascot [1]
Paradigm Multi-paradigm
Family Perl
Designed by Larry Wall
Developer Raku community
First appeared25 December 2015;8 years ago (2015-12-25)
Stable release
6.d 'Diwali' [2] / 24 October 2020;3 years ago (2020-10-24)
Typing discipline Dynamic, gradual
OS Cross-platform
License GNU General Public License or Artistic License 2
Filename extensions .raku, .rakumod, .rakudoc, .t, .rakutest [3]
Website raku.org
Major implementations
Rakudo
Influenced by
Perl, Ruby, Smalltalk, Haskell, [4] JavaScript
Influenced
Perl, [5] Haskell, [5] AntLang

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

Contents

History

In Perl 6, we decided it would be better to fix the language than fix the user.

Larry Wall [9]

The Raku design process was first announced on 19 July 2000, on the fourth day of that year's Perl Conference, [10] by Larry Wall in his State of the Onion 2000 talk. [11] 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 APIs. The process began with a series of requests for comments or "RFCs". This process was open to all contributors, and left no aspect of the language closed to change. [12]

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". [13] 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, [14] while the Synopses are kept as a historical reference. [15]

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. [16]

There are three primary methods of communication used in the development of Raku today. The first is the raku IRC channel on Libera Chat. The second is a set of mailing lists. [17] The third is the Git source code repository hosted at GitHub. [18]

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.[ citation needed ]

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

Larry Wall and Camelia FOSDEM 2015 Larry Wall and Camelia the Perl6 logo.jpg
Larry Wall and Camelia

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

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. [20]

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." [21]

Rakudo Perl 6 [22] [23] targets a number of virtual machines, such as MoarVM, the Java Virtual Machine, and JavaScript. MoarVM is a virtual machine built especially for Rakudo [24] and the NQP Compiler Toolchain. [25] There is a layer between Raku and the virtual machines called Not Quite Perl 6, or NQP, which implements Raku rules for parsing Raku, as well as an abstract syntax tree and backend-specific code generation. Large portions of Rakudo are written in Raku itself, 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. 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 GHC). As of November 2014 Pugs was not being actively maintained. [26]

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. [27] [28] 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 itself. As a result, it required an existing Perl 6 interpreter, such as one of the Rakudo Star releases, in order to run. [29]

Niecza, another major Perl 6 implementation effort, focused on optimization and efficient implementation research. It targets the Common Language Infrastructure. [30]

Module system

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

Books

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

Also, a book dedicated to one of the first Perl 6 virtual machines, Parrot, was published in 2009.

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

Books published with the new Raku name

Related Research Articles

<span class="mw-page-title-main">Perl</span> Interpreted programming language first released in 1987

Perl is a high-level, general-purpose, interpreted, dynamic programming language. Though Perl is not officially an acronym, there are various backronyms in use, including "Practical Extraction and Reporting Language".

Parrot is a discontinued register-based process virtual machine designed to run dynamic languages efficiently. It is possible to compile Parrot assembly language and Parrot intermediate representation to Parrot bytecode and execute it. Parrot is free and open-source software.

Programming languages can be grouped by the number and types of paradigms supported.

<span class="mw-page-title-main">D (programming language)</span> Multi-paradigm system programming language

D, also known as dlang, is a multi-paradigm system programming language created by Walter Bright at Digital Mars and released in 2001. Andrei Alexandrescu joined the design and development effort in 2007. Though it originated as a re-engineering of C++, D is now a very different language drawing inspiration from other high-level programming languages, notably Java, Python, Ruby, C#, and Eiffel.

Plain Old Documentation (pod) is a lightweight markup language used to document the Perl programming language as well as Perl modules and programs.

Pugs is a compiler and interpreter for the Raku programming language, started on February 1, 2005, by Audrey Tang.

<span class="mw-page-title-main">Damian Conway</span>

Damian Conway is a computer scientist, a member of the Perl and Raku communities, a public speaker, and the author of several books. Until 2010, he was also an adjunct associate professor in the Faculty of Information Technology at Monash University.

Berkeley Yacc (byacc) is a Unix parser generator designed to be compatible with Yacc. It was originally written by Robert Corbett and released in 1989. Due to its liberal license and because it was faster than the AT&T Yacc, it quickly became the most popular version of Yacc. It has the advantages of being written in ANSI C89 and being public domain software.

<span class="mw-page-title-main">LAMP (software bundle)</span> Acronym for a common web hosting solution

LAMP is an acronym denoting one of the most common software stacks for the web's most popular applications. Its generic software stack model has largely interchangeable components.

Raku rules are the regular expression, string matching and general-purpose parsing facility of the Raku programming language, and are a core part of the language. Since Perl's pattern-matching constructs have exceeded the capabilities of formal regular expressions for some time, Raku documentation refers to them exclusively as regexes, distancing the term from the formal definition.

The Parser Grammar Engine is a compiler and runtime for Raku rules for the Parrot virtual machine. PGE uses these rules to convert a parsing expression grammar into Parrot bytecode. It is therefore compiling rules into a program, unlike most virtual machines and runtimes, which store regular expressions in a secondary internal format that is then interpreted at runtime by a regular expression engine. The rules format used by PGE can express any regular expression and most formal grammars, and as such it forms the first link in the compiler chain for all of Parrot's front-end languages.

Test::More is a unit testing module for Perl. Created and maintained by Michael G Schwern with help from Barrie Slaymaker, Tony Bowden, chromatic, Fergal Daly and perl-qa.

<span class="mw-page-title-main">Sass (style sheet language)</span> Stylesheet language

Sass is a preprocessor scripting language that is interpreted or compiled into Cascading Style Sheets (CSS). SassScript is the scripting language itself.

<span class="mw-page-title-main">Rakudo</span>

Rakudo is a Raku compiler targeting MoarVM, and the Java Virtual Machine, that implements the Raku specification. It is currently the only major Raku compiler in active development.

<span class="mw-page-title-main">Padre (software)</span> Perl software development platform

Padre is a multi-language software development platform comprising an IDE and a plug-in system to extend it. It is written primarily in Perl and is used to develop applications in this language.

Haskell is a general-purpose, statically-typed, purely functional programming language with type inference and lazy evaluation. Designed for teaching, research, and industrial applications, Haskell has pioneered a number of programming language features such as type classes, which enable type-safe operator overloading, and monadic input/output (IO). It is named after logician Haskell Curry. Haskell's main implementation is the Glasgow Haskell Compiler (GHC).

<span class="mw-page-title-main">Rust (programming language)</span> General-purpose programming language

Rust is a multi-paradigm, general-purpose programming language that emphasizes performance, type safety, and concurrency. It enforces memory safety—meaning that all references point to valid memory—without a garbage collector. To simultaneously enforce memory safety and prevent data races, its "borrow checker" tracks the object lifetime of all references in a program during compilation.

The following outline is provided as an overview of and topical guide to the Perl programming language:

MoarVM is a virtual machine built for the 6model object system. It is being built to serve as yet another VM backend for Raku. MoarVM was created to allow for greater efficiency than Parrot by having a closer internal representation to the model system used by Raku. Notably it was the virtual machine for the first stable version of Rakudo released in December 2015.

<span class="mw-page-title-main">Nim (programming language)</span> Programming language

Nim is a general-purpose, multi-paradigm, statically typed, compiled high-level systems programming language, designed and developed by a team around Andreas Rumpf. Nim is designed to be "efficient, expressive, and elegant", supporting metaprogramming, functional, message passing, procedural, and object-oriented programming styles by providing several features such as compile time code generation, algebraic data types, a foreign function interface (FFI) with C, C++, Objective-C, and JavaScript, and supporting compiling to those same languages as intermediate representations.

References

  1. 1 2 Jackson, Joab (23 July 2010). "Perl creator hints at imminent release of long-awaited Perl 6". IDG News Service. Retrieved 8 February 2015.
  2. "Announce: Raku Perl 6 'Diwali' 6.d Language Specification Release". blogs.perl.org. Zoffix Znet. 5 November 2018. Retrieved 19 August 2022.
  3. "Modules". docs.raku.org. Retrieved 19 August 2022.
  4. "Glossary of Terms and Jargon". Perl Foundation Perl 6 Wiki. The Perl Foundation. 28 February 2011. Archived from the original on 21 January 2012. Retrieved 8 February 2015.
  5. 1 2 唐鳳, a.k.a. Audrey Tang (21 April 2010). "How to Implement Perl 6 in '10".
  6. "About Perl". perl.org. Retrieved 11 June 2020. "Perl" is a family of languages, "Raku" (formerly known as "Perl 6") is part of the family, but it is a separate language which has its own development team. Its existence has no significant impact on the continuing development of "Perl".
  7. "Perl 6 renamed to Raku". LWN.net. 15 October 2019. Retrieved 16 October 2019.
  8. "TPF response to Raku rename". 29 October 2019.
  9. Biancuzzi, Federico; Warden, Shane (2009). Masterminds of Programming: Conversations with the Creators of Major Programming Languages. "O'Reilly Media, Inc.". ISBN   978-0596515171.
  10. Kline, Joe (21 August 2000). "Report from the Perl Conference".
  11. Wall, Larry (2000). "State of the Onion 2000". O'Reilly Network.
  12. The Perl Foundation (2000). "About Perl 6 RFCs".
  13. Wall, Larry (2 April 2001). "Apocalypse 1: The Ugly, the Bad, and the Good".
  14. "Raku test suite". GitHub . 2019.
  15. Larry Wall and the Perl 6 designers (2015). "Perl 6 Design Documents".{{cite web}}: CS1 maint: numeric names: authors list (link)
  16. The Perl Foundation (2001). "Exegeses".
  17. The Raku Programming Language (2022). "Raku Community".
  18. "Raku". GitHub. Retrieved 19 August 2022.
  19. "Larry Wall in IRC chat log". 15 January 2016. Retrieved 10 November 2017.
  20. "Archived "Logo considerations" email from Larry Wall". GitHub . 24 March 2009. Retrieved 10 November 2017.
  21. Wall, Larry (10 August 2004). "Synopsis 1: Overview".
  22. "rakudo/rakudo - GitHub". Github.com. Retrieved 21 September 2013.
  23. Michaud, Patrick (16 January 2008). "The compiler formerly known as 'perl6'". Archived from the original on 18 February 2012.
  24. Worthington, Jonathan (31 May 2013). "MoarVM: A virtual machine for NQP and Rakudo". 6guts. Retrieved 24 July 2013.
  25. "NQP - Not Quite Perl at github". GitHub . 29 May 2022. Retrieved 29 May 2022.
  26. "Feature comparison of Perl 6 compilers". Archived from the original on 7 February 2019.
  27. Wall, Larry; et al. (2007). "Perl 6 STD". GitHub .
  28. "mp6/kp6 FAQ". Perl 6 development team. 2006.
  29. "Yapsi README". GitHub . 2011.
  30. O'Rear, Stefan (29 November 2011). "Niecza README.pod". GitHub . Retrieved 12 January 2012.
  31. Wall, Larry (2004). "Synopsis 11: Modules".
  32. "Perl 6 Modules Directory". Modules.raku.org. Retrieved 17 May 2020.