Before you can use Parrot, you have to get it running on your machine.
The simplest way to install Parrot is to use a pre-compiled binary for your operating system or distribution. Packages are available for many packaging systems, including Debian, Ubuntu, Fedora, Mandriva, FreeBSD, Cygwin, and MacPorts. The Parrot website lists all known packages at http://www.parrot.org/download. A binary installer for Windows is also available at http://parrotwin32.sourceforge.net/.
If packages aren't available on your system, download the latest supported release from http://www.parrot.org/release/supported.
You need a C compiler and a make utility to build Parrot from source code -- usually
but Parrot can build with standard compiler toolchains on different operating systems.
Perl 5.8 is also a prerequiste for configuring and building Parrot.
If you have these dependencies installed, build the core virtual machine and compiler toolkit and run the standard test suite with the commands:
$ perl Configure.pl $ make $ make test
By default, Parrot installs to directories bin/, lib/, et cetera under the prefix /usr/local. If you have privileges to write to these directories, install Parrot with:
$ make install
To install Parrot beneath a different prefix, use the
--prefix option to
$ perl Configure.pl --prefix=/home/me/parrot
If you intend to develop -- not just use -- a language on Parrot, install the Parrot developer tools as well:
$ make install-dev
Once you've installed Parrot, run it. Create a test file called news.pasm.
.pasm files contain Parrot Assembly Language (PASM) instructions; this is a low-level language native to the Parrot virtual machine.
Now run this file with:
$ parrot news.pasm
which will print:
Here is the news for Parrots.
Next, try out one of Parrot's high-level languages. Create a test file called more_news.nqp:
say( "No parrots were involved in an accident on the M1 today..." );
Then run it as:
$ parrot-nqp more_news.nqp
which will print:
No parrots were involved in an accident on the M1 today...
This book describes Parrot in terms of tasks it supports. You may pick and choose chapters based on your area of interest:
Parrot Intermediate Representation (PIR) is a mid-level language native to the Parrot virtual machine s commonly used for writing extensions and tools for Parrot.
The Parrot Compiler Toolkit (PCT) provides a common infrastructure and utilities for implementing languages on Parrot.
The Parrot Grammar Engine (PGE) is a powerful regular expression engine and recursive descent parser. PGE is part of the compiler tools; understanding PGE is essential to implementing a language on Parrot.
NQP (Not Quite Perl) is a lightweight language loosely inspired by Perl 6. NQP is part of the compiler tools used for transforming a Parrot-hosted language into instructions for Parrot to execute.
This chapter suggests the need for a chapter on core PMCs. Alternately, this chapter could cover PMCs in general and dynpmcs as a special case of PMCs.
Parrot allows language developers to extend Parrot's core data types to suit the needs of advanced languages.
The same point applies for ops and dynops.
Parrot allows language developers to extend Parrot's core instruction set -- again to suit the needs of advanced languages.
Parrot's standard instruction set provides powerful behavior for primitive operations, control flow, object orientation, exception handling, and more.
Parrot supports directives used within PIR and PASM code to change the behavior of code and to control what happens in bytecode.
PIR provides several higher-level operators as a convenience to programmers and code generators.
Parrot and its environment have common jargon.
Parrot supports several flags to control execution modes, debugging, library loading, and more.
Parrot's configuration process gives administrators and developers tremendous control over the build system.
Parrot's source code is organized along logical lines -- logical, once you know the layout.
Parrot depends on the combined efforts of numerous volunteers. Your contributions are very welcome.