Pugs (compiler) explained

Pugs
Author:Audrey Tang
Discontinued:Yes
Latest Release Version:Final
Programming Language:Haskell
Platform:IA-32, x86-64
Genre:compilerinterpreter
Licence:-->

Pugs is a compiler and interpreter for the Raku programming language, begun on 1 February 2005, by Audrey Tang. Raku was then called Perl 6.

As of 21 April 2010, Pugs development was placed on hiatus,[1] with most Raku implementation efforts moving to Rakudo.

Overview

The Pugs project aimed to bootstrap Perl 6 by implementing the full Perl 6 specification, as detailed in the Synopses. It is written in Haskell, specifically targeting the Glasgow Haskell Compiler.

Pugs includes two main executables:

Pugs is free and open-source software, distributable under the terms of either the GNU General Public License or the Artistic License.[2] These are the same terms as Perl.

Version numbering

The major/minor version numbers of Pugs converge to 2π (being reminiscent of TeX and Metafont, which use a similar scheme); each significant digit in the minor version represents a successfully completed milestone. The third digit is incremented for each release. The current milestones are:

Perl 5 compatibility

As of version 6.2.6, Pugs also has the ability to embed Perl 5 and use CPAN modules installed on the system. The example below demonstrates the use of the popular Perl DBI module to manage a database:

  1. !/usr/bin/pugs

use v6;use perl5:DBI;

my $dbh = DBI.connect('dbi:SQLite:dbname=test.db');$dbh.do("CREATE TABLE Test (Project, Pumpking)");

my $sth = $dbh.prepare("INSERT INTO Test VALUES (?, ?)");$sth.execute();$sth.execute();$sth.execute();

my $res = $dbh.selectall_hashref('SELECT * FROM Test', 'Pumpking');

  1. Just another Pugs hacker

say "Just another $res hacker";

Development model

Several factors have been suggested as reasons for Pugs's progress:

Despite these factors, progress on the Haskell implementation stalled in late 2006, as personal issues kept Audrey from devoting as much time to the project as she had in 2005.

Many Pugs contributors have since moved on to implement Perl6-inspired systems as CPAN modules on Perl 5, such as the Moose project.

External links

Notes and References

  1. News: Tang . Audrey . Audrey Tang . 21 April 2010 . How to Implement Perl 6 in '10 . Pugs Blogs.
  2. Web site: Pugs Apocryphon 1 . 2007-03-09 . 2007-03-05 . https://web.archive.org/web/20070305173601/http://svn.pugscode.org/pugs/docs/01Overview.html . dead.