A Fast Introduction to Parrot

The Parrot virtual machine [4] is register based. This means that, like a hardware CPU, it has a number of fast-access units of storage called registers. There are 4 types of register in Parrot: integers (I), numbers (N), strings (S) and PMCs (P). For each type there are several of these, named $N0, $N1, ...Number registers map to the machine native floating point type. You can download a recent version of parrot from http://www.parrot.org/download.

The code produced by infix2pir.pl is an example of PIR, which stands for Parrot Intermediate Representation and is also known as Intermediate Code or IMC. PIR files use the extension .pir. PIR is an intermediate language that can be compiled to Parrot Byte code (PBC). It was conceived as a possible target language for compilers targeting the Parrot Virtual Machine. PIR is halfway between a High Level Language (HLL) and Parrot Assembly (PASM).

PIR has a relatively simple syntax. Every line is a comment, a label, a statement, or a directive. Each statement or directive stands on its own line. There is no end-of-line symbol (such as a semicolon in C). These is a brief enumeration of the main characteristics of the language:

Procesadores de Lenguajes 2010-01-31