Pugs

from Wikipedia, the free encyclopedia
Pugs
Basic data

operating system Platform independence
programming language Haskell
License MIT license
http://www.pugs.com (offline)

Pugs is an alternative interpreter and compiler for Perl 6 written in Haskell (GHC). The software project was started on February 1, 2005 by Audrey Tang to support the creation of Perl 6. It is free software that can be used either under the GPL or the Artistic License .

purpose

On the one hand, Pugs serves as a test implementation for the Perl 6 parser . Major mistakes that were made in pugs can then be avoided later, but it will also reveal syntax weaknesses in the design of the Perl 6 language at a time when corrections are still relatively easy.

Second , the actual Perl 6 parser (written in Perl 6) will be a program that is compiled by Pugs to Parrot byte code. Already today it is possible to generate Parrot code with Pugs, or to compile Parrot code generated by Parrot with Pugs. Starting with version 6.2.8, Pugs can also compile Perl 6 code to Perl 5. This helped to avoid bottlenecks when both the language and Parrot had significant gaps.

With version 6.2.8 the goals of the project have changed slightly. Pugs should become a complete Perl 6 compiler, the Perl 6 after Parrot (PIR), Haskell or Perl 5 and other languages, e.g. B. JavaScript, can translate. In doing so, Haskell rewrites as many of the Pug components as possible into Perl 6 modules that can be used later.

Surname

Pugs means pugs in English and a pug also serves as the logo of the project. Officially, Pugs is an acronym for Perl6 User Golfing System, which is a reference to Perl Golf .

Versions

Versioning of Pugs starts with 6.0, and a digit will be added with each new milestone so that the version number emulates twice that of Pi . This goes back to a joke by Larry Wall who, when asked about a Perl 7, explained why Perl in its version shouldn't exceed 2 * Pi. The current version is 6.2.13.20130611 (June 11, 2013).

status

Pugs can be divided into several sub-projects.

  • Pugs' parser is able to parse "standard Perl". Custom operators are also supported, but a complete redesign of the grammar is not yet possible.
  • Pugs' Evaluator supports most of the builtins as well as many object-oriented routines. Its main problem at the moment is its comparatively low speed.
  • Pugs' compiler for PIL is available and stable.
  • As we continue to work on Pugs' compiler for PIR (Parrot), we are waiting for some Parrot features.
  • Pugs' compiler for JavaScript is still a very young sub-project; many builtins are already supported, but the speed of the resulting JavaScript code is very slow.

meaning

Even if only the most necessary maintenance has been done since mid-2007, Pugs was essential for Perl 6 to be as it is today. During a phase in which, despite several years of work on Parrot and Rakudo, there were hardly any visible results, Audrey Tang managed in a short time to confront the discussions about syntactic details with practical experience, which made the work more fruitful and raised morale. As a result, the test suite that still exists today and is valid for all implementations , as well as the first modules and example programs , was created. A fresh and inviting style of communication resulted in a large number of sub-projects from Pugs, which checked the feasibility of several thought experiments. The most important today is surely Moose, the most widespread and most powerful OOP framework for Perl 5. Main developer Stefan Little sees this as the logical continuation of his experience with Pugs.

Web links

  1. Pugs.hs: Perl6 User's Golfing system in Haskell . (accessed on February 3, 2018).