All Topics  
Pugs

 

   Email Print
   Bookmark   Link






 

Pugs



 
 
Pugs is a compiler
Compiler

A compiler is a computer program that transforms source code written in a programming language into another computer language . The most common reason for wanting to transform source code is to create an executable program....
 and interpreter
Interpreter (computing)

In computer science, an interpreter normally means a computer program that execution , i.e. performs, instructions written in a programming language....
 for the Perl 6
Perl 6

Perl 6 is a planned major revision to the Perl programming language. It is a language specification which introduces elements of many modern and historical languages....
 programming language
Programming language

A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer....
, started on February 1 2005 by Audrey Tang
Audrey Tang

Audrey Tang is a Taiwanese people free software programmer, who has been described as one of the "ten greats of Taiwanese computing."...
.

Pugs project aims to bootstrap
Bootstrapping (compilers)

Bootstrapping is a term used in computer science to describe the techniques involved in writing a compiler in the target programming language which it is intended to compile....
 Perl 6 by implementing the full Perl 6 specification, as detailed in the . It is written in Haskell
Haskell (programming language)

Haskell is a standardized, purely functional programming language with non-strict programming language, named after logician Haskell Curry. The goals of the language are described as:...
, specifically targeting the Glasgow Haskell Compiler
Glasgow Haskell Compiler

The Glorious Glasgow Haskell Compilation System, more commonly known as the Glasgow Haskell Compiler or GHC, is an open source Machine language compiler for the functional programming Computer programming Programming language Haskell ....
.

Pugs includes two main executables:

Pugs is free software
Free software

Free Software or software libre is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with minimal restrictions only to ensure that further recipients can also do these things and to prevent consumer-facing hardware...
, distributable under the terms of either the GNU General Public License
GNU General Public License

The GNU General Public License is a widely used free software license, originally written by Richard Stallman for the GNU project. The GPL is the most popular and well-known example of the type of strong copyleft license that requires derived works to be available under the same copyleft....
 or the Artistic License
Artistic License

The Artistic License refers most commonly to the original Artistic License , a software license used for certain free software packages, most notably the standard Perl implementation and most CPAN modules, which are dual-licensed under the Artistic License and the GNU General Public License ....
.






Discussion
Ask a question about 'Pugs'
Start a new discussion about 'Pugs'
Answer questions from other users
Full Discussion Forum



Encyclopedia


Pugs is a compiler
Compiler

A compiler is a computer program that transforms source code written in a programming language into another computer language . The most common reason for wanting to transform source code is to create an executable program....
 and interpreter
Interpreter (computing)

In computer science, an interpreter normally means a computer program that execution , i.e. performs, instructions written in a programming language....
 for the Perl 6
Perl 6

Perl 6 is a planned major revision to the Perl programming language. It is a language specification which introduces elements of many modern and historical languages....
 programming language
Programming language

A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer....
, started on February 1 2005 by Audrey Tang
Audrey Tang

Audrey Tang is a Taiwanese people free software programmer, who has been described as one of the "ten greats of Taiwanese computing."...
.

Overview

The Pugs project aims to bootstrap
Bootstrapping (compilers)

Bootstrapping is a term used in computer science to describe the techniques involved in writing a compiler in the target programming language which it is intended to compile....
 Perl 6 by implementing the full Perl 6 specification, as detailed in the . It is written in Haskell
Haskell (programming language)

Haskell is a standardized, purely functional programming language with non-strict programming language, named after logician Haskell Curry. The goals of the language are described as:...
, specifically targeting the Glasgow Haskell Compiler
Glasgow Haskell Compiler

The Glorious Glasgow Haskell Compilation System, more commonly known as the Glasgow Haskell Compiler or GHC, is an open source Machine language compiler for the functional programming Computer programming Programming language Haskell ....
.

Pugs includes two main executables:
  • pugs is the interpreter with an interactive shell.
  • pugscc can compile Perl 6 programs into Haskell code, Perl 5, JavaScript
    JavaScript

    JavaScript is a scripting language widely used for client-side web development. It was the originating Programming language dialect of the ECMAScript standard....
    , or Parrot virtual machine
    Parrot virtual machine

    Parrot is a register machine virtual machine being developed using the C and intended to run dynamic languages efficiently. It uses just-in-time compilation for speed to reduce the interpretation overhead....
    's PIR
    Parrot intermediate representation

    The Parrot intermediate representation or PIR, previously called Intermediate code , is one of the two assembly languages for the Parrot virtual machine....
     assembly.


Pugs is free software
Free software

Free Software or software libre is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with minimal restrictions only to ensure that further recipients can also do these things and to prevent consumer-facing hardware...
, distributable under the terms of either the GNU General Public License
GNU General Public License

The GNU General Public License is a widely used free software license, originally written by Richard Stallman for the GNU project. The GPL is the most popular and well-known example of the type of strong copyleft license that requires derived works to be available under the same copyleft....
 or the Artistic License
Artistic License

The Artistic License refers most commonly to the original Artistic License , a software license used for certain free software packages, most notably the standard Perl implementation and most CPAN modules, which are dual-licensed under the Artistic License and the GNU General Public License ....
. These are the same terms as Perl.

Version numbering

The major/minor version numbers of Pugs converges to 2p (being reminiscent of TeX
TeX

TeX is a typesetting system designed and mostly written by Donald Knuth. Together with the METAFONT language for font description and the Computer Modern typefaces, it was designed with two main goals in mind: to allow anybody to produce high-quality books using a reasonable amount of effort, and to provide a system that would give the exact...
 and METAFONT
METAFONT

Metafont is a programming language used to define outline font. It is also the name of the interpreter that executes Metafont code, generating the bitmap fonts that can be embedded into e.g....
, which use 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:
  • 6.0: Initial release.
  • 6.2: Basic IO and control flow elements; mutable variables; assignment.
  • 6.28: Classes and traits.
  • 6.283: Rules and Grammars.
  • 6.2831: Type system and linking.
  • 6.28318: Macros.
  • 6.283185: Port Pugs to Perl 6, if needed.


Perl 5 compatibility

As of version 6.2.6, Pugs also has the ability to embed Perl 5 and use CPAN
CPAN

CPAN, the Comprehensive Perl Archive Network, is an archive of over 14,800 modules of software written in Perl, as well as documentation for it....
 modules installed on the system. The example below demonstrates the use of the popular Perl DBI
Perl DBI

Perl DBI is the most common database interface for the Perl programming language.DBI was specified by Tim Bunce, in collaboration with others, starting in 1992, and is currently maintained across the Internet as a CPAN module in accordance with the Open Source model....
 module to manage a database:

#!/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'); # Just another Pugs hacker say "Just another $res hacker";

Development model

Several factors have been suggested as reasons for Pugs's progress:
  • Haskell's static typing can make it easier for program bugs to be detected at compile time. Haskell code is also often thought to be concise. The Parsec library, a monadic
    Monads in functional programming

    In functional programming, a monad is a kind of abstract data type used to represent computations . Programs written in functional style can make use of monads to structure procedures that include sequenced operations, or to define arbitrary control flows ....
     combinatorial parser written entirely in Haskell, simplifies parsing. Because Haskell is a purely functional language
    Purely functional

    Purely functional is a term in computing used to describe algorithms, data structures or programming languages that exclude destructive modifications ....
    , making the functional code interact with the real world (inputs/outputs and time-driven environment) requires thought. To achieve this, Pugs makes extensive use of monads
    Monads in functional programming

    In functional programming, a monad is a kind of abstract data type used to represent computations . Programs written in functional style can make use of monads to structure procedures that include sequenced operations, or to define arbitrary control flows ....
    .
  • Pugs's use of test-driven methodology
    Test-driven development

    Test-driven development is a software development technique that uses short development iterations based on pre-written test cases that define desired improvements or new functions....
     (a tenet of Extreme Programming
    Extreme Programming

    Extreme Programming is a software engineering methodology prescribing a set of daily stakeholder Extreme Programming#Practices that embody and encourage particular Extreme Programming#XP values ....
    ). This methodology dictates that every module should have test code, even before the modules are implemented. Advocates of this methodology argue that it improves software quality
    Software quality

    In the context of software engineering, software quality measures how well software is designed , and how well the software conforms to that design , although there are several different definitions....
    . However, the project often silenced failed regression tests before releases, removing much of the benefit of test-driven development.
  • Tang's liberal granting of the commit bit
    Commit bit

    The Commit bit is permission to contribute to a shared source code for a software project.To contribute source code on most large projects, one must make modifications and then "commit" those changes to a central repository such as Concurrent Versions System....
    . Pugs development is currently based around a Subversion repository, and access is freely given - especially to people wishing to write tests. Because of this, a huge library of tests has accumulated. Other Perl 6 implementations rely on many tests developed for Pugs as an executable specification for Perl 6.
  • Tang's communication style; her journal (linked below) attracted many people to the project. Pugs developers also gather on the #perl6 freenode
    Freenode

    freenode, formerly known as Open Projects Network, is a popular Internet Relay Chat computer network used to discuss peer-directed projects....
     IRC channel.


Despite these factors, progress on Pugs itself stalled in 2006 as personal issues kept Audrey from devoting as much time to the project as she had in 2005. Though development continues, few contributors actively work on the Haskell-based interpreter, making its progress much slower than many people had hoped at the start of the project.

External links