Parrot virtual machine Guide, Meaning , Facts, Information and Description
Parrot is a register-based virtual machine being developed by the Perl community. It will be the target for the Perl 6 interpreter. Most other virtual machines like the Java virtual machine are stack based. The developers see it as an advantage of the Parrot machine that it has registers, and therefore more closely resembles an actual hardware design, allowing the vast literature on compiler optimization to be used generating code for the Parrot virtual machine.
| Table of contents |
|
2 History 3 Internals 4 Examples 5 Culture 6 External links |
Parrot is a free software project, distributed under the same terms as Perl, i.e. it is dual-licensed under both the GNU General Public License and the Artistic License.
The project started to implement Perl 6 and originally had the very dull name "The software we're writing to run Perl 6". The name Parrot came from an April Fool's joke in which
a hypothetical language named Parrot was announced that would
unify Python and Perl. Later, the name was adopted by this project whose intent is to do just that. Several tiny languages are developed along with it which target the parrot virtual machine.
Parrot 0.1.0 "Leaping Kakapo" was released on February 20th 2004. Parrot 0.1.1 "Poicephalus" was released on October 9th 2004.
The Parrot virtual machine uses PASM, Parrot assembly language., and PIR, Parrot's Intermediate Representation (also known as IMCC, named after the compiler, InterMediate Code Compiler, for it).
Unlike most of stack-based virtual machines, Parrot is register-based, just like most of hardware CPUs. It provides 32 registers for every one of four types:
License
History
Internals
Internal languages
Examples
Registers
Arithmetic operations
set I1, 10
inc I1 # I1 is now 11
add I1, 2 # I1 is now 13
set N1, 42.0
dec N1 # N1 is now 41.0
sub N1, 2.0 # N1 is now 39.0
print I1
print ", "
print N1
print "\
"
end
Culture
Tagline
The current tagline of the Parrot project is "one bytecode to rule them all," a reference to Tolkien's One Ring from The Hobbit & Lord of the Rings stories.
