Skip to content
bschmalhofer edited this page Sep 13, 2010 · 30 revisions

What is Pipp?

Pipp is Parrot’s PHP.
The project Pipp aims to implement the language PHP on top of the virtual machine Parrot.

Pipp uses the Parrot Compiler Toolkit for parsing the PHP source code.
The target of compilation target is the Parrot Abstract Syntax Tree.
For execution the Parrot Abstract Syntax Tree is translated to Parrot Byte Code.
Getting started with Pipp

  • Get and build Parrot
  • Get Pipp from http://github.com/bschmalhofer/pipp/tree/master: cd languages; make co-pipp
  • Build Pipp: cd pipp; make
  • Run some tests: make smoke

Testing

PHP 5.3 is the reference implementation, therefore the PHP 5.3 test suite is used for spectesting.
Here are the test results for the core and the extensions ‘standard’ and ‘Reflection’ at revision 36093 on 2009-01-28:

  =====================================================================
  TEST RESULT SUMMARY
  ---------------------------------------------------------------------
  Exts skipped    :   75
  Exts tested     :    2
  ---------------------------------------------------------------------

  Number of tests : 9229              4717
  Tests skipped   : 4512 ( 48.9%) --------
  Tests warned    :    0 (  0.0%) (  0.0%)
  Tests failed    : 4646 ( 50.3%) ( 98.5%)
  Expected fail   :    5 (  0.1%) (  0.1%)
  Tests passed    :   66 (  0.7%) (  1.4%)
  ---------------------------------------------------------------------
  Time taken      : 14658 seconds
  =====================================================================

Smoke tests of the Pipp test suite can be viewed at http://smolder.plusthree.com/app/public_projects/smoke_reports/10.
Submitting patches

Bug reports and patches for Pipp are highly appreciated. Currently there is no separate issue tracking for Pipp.
So please follow the instructions in http://svn.perl.org/parrot/trunk/docs/submissions.pod for filing contributions.
Status of the Implementation

This is is an overview over the status of the implementation of the PCT variant of Pipp.

It is based on the PHP language reference.
Basic Syntax
Instruction separation

The <?php and ?> tag pair is supported. The tag pair is supported in a limited way. Short tags, <? and ?> , and ASP-style tags, [% and %], are not supported.
Comments

Supported, but the special case with e.g. ‘# ?>’ is broken.
Types
Booleans

Supported.
Integers

Supported
Floating point numbers

Supported
Strings

Supported
Arrays

Supported
Objects

See PHP OO for Perl 6 programmers.
Resources

Not yet supported.
NULL

Not yet supported.
Variables
Constants
Expressions
Operators
Control Structures
Functions
Classes and Objects
Namespaces
Exceptions
References
Predefined variables
Predefined Exceptions

History of Pipp

The initial name of this project was Plumhead, named after the Plum-headed Parakeet.

An initial goal of Pipp was to provide a side by side comparison of different parser and tree transformation techniques.
That’s why until Parrot 0.8.2 there were three different variants of Pipp.
Pipp PCT

Parse with the parrot compiler toolkit and with grammar action defined in NQP. This is the default variant.
Pipp PHC

Takes XML output from phc and transform it with XSLT to NQP setting up a PAST datastructure. NQP is Not Quite Perl6.
Pipp antlr3

ANTLR3 generates Java classes as Parser and TreeParser.

Standard library

CGI parameter parsing in done in the Parrot library CGI;QueryHash.

Clone this wiki locally