Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 History  





2 Languages  



2.1  Static and dynamic languages  





2.2  Functional concepts  





2.3  Compiler tools  





2.4  Implementations  







3 Internals  





4 Examples  



4.1  Registers  





4.2  Arithmetic operations  







5 See also  





6 References  





7 External links  














Parrot virtual machine






Български
Deutsch
Español
Français

Nederlands

Polski
Português
Русский
Українська

 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 




In other projects  



Wikibooks
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


Parrot virtual machine
Final release

8.1.0 / February 16, 2016; 8 years ago (2016-02-16)[1]

Repository
Written inC
Operating systemCross-platform
SuccessorMoarVM (for Raku)
TypeVirtual machine
LicenseArtistic License 2.0
Websitewww.parrot.org Edit this at Wikidata

Parrot is a discontinued register-based process virtual machine designed to run dynamic languages efficiently. It is possible to compile Parrot assembly language and Parrot intermediate representation (PIR, an intermediate language) to Parrot bytecode and execute it. Parrot is free and open-source software.[2]

Parrot was started by the Perl community and developed with help from the open-source and free software communities. As a result, it was focused on license compatibility with Perl (Artistic License 2.0), platform compatibility across a broad array of systems, processor architecture compatibility across most modern processors, speed of execution, small size (around 700k depending on platform), and the flexibility to handle the varying demands made by Raku and other modern dynamic languages.

Version 1.0, with a stable application programming interface (API) for development, was released on March 17, 2009.[3] The last version is release 8.1.0 "Andean Parakeet".[1] Parrot was officially discontinued in August 2021, after being supplanted by MoarVM in its main use (Raku) and never becoming a mainstream VM for any of its other supported languages.[4]

History[edit]

The name Parrot came from an April Fool's joke which announced a hypothetical language, named Parrot, that would unify Python and Perl.[5][6] The name was later adopted by the Parrot project (initially a part of the Raku development effort) which aimed to support Raku, Python, and other programming languages.

The Parrot Foundation was dissolved in 2014.[7] The Foundation was created in 2008 to hold the copyright and trademarks of the Parrot project, to help drive development of language implementations and the core codebase, to provide a base for growing the Parrot community, and to reach out to other language communities.[8]

Historical design decisions are documented in the form of Parrot Design Documents, or PDDs, in the Parrot repository.[9]

Until late 2005, Dan Sugalski was the lead designer and chief architect of Parrot. Chip Salzenberg, a longtime Perl, Linux kernel, and C++ hacker, took over until mid-2006, when he became the lead developer. Allison Randal, the lead developer of Punie and chief architect of Parrot's compiler tools, was the chief architect until mid-October 2010 when she stepped down and chose Christoph Otto as the new chief architect.[10]

Languages[edit]

The goal of the Parrot virtual machine was to host client languages and allow inter-operation between them. Several hurdles exist in accomplishing this goal, in particular the difficulty of mapping high-level concepts, data, and data structures between languages.

Static and dynamic languages[edit]

The differing properties of statically and dynamically typed languages motivated the design of Parrot. Current popular virtual machines such as the Java virtual machine and the Common Language Runtime, for the .NET platform, have been designed for statically typed languages, while the languages targeted by Parrot are dynamically typed.

Virtual machines such as the Java virtual machine and the current Perl 5 virtual machine are also stack based. Parrot developers chose a register-based design, reasoning that it more closely resembles a hardware design, allowing the vast literature on compiler optimization to be used in generating bytecode for the Parrot virtual machine that could run at speeds closer to machine code.[citation needed] Other register-based virtual machines inspired parts of Parrot's design, including LLVM, the Lua VM and Inferno's Dis.

Functional concepts[edit]

Parrot has rich support for several features of functional programming including closures and continuations, both of which can be particularly difficult to implement correctly and portably, especially in conjunction with exception handling and threading. The biggest advantage is the dynamic extendability of objects with methods, which allows for polymorphic containers (PMCs) and associated opcodes. Implementing solutions to these problems at the virtual machine level obviates the need to solve them in the individual client languages.

Compiler tools[edit]

Parrot provides a suite of compiler-writing tools[11] which includes the Parser Grammar Engine (PGE), a hybrid parser-generator that can express a recursive descent parser as well as an operator-precedence parser, allowing free transition between the two in a single grammar. The PGE feeds into the Tree Grammar Engine (TGE) which further transforms the parse-tree generated by PGE for optimization and ultimately for code generation.

Implementations[edit]

The most complete language implementations targeting the Parrot VM were Raku (known at the time as Rakudo Perl 6), Lua and a new language called "Winxed".[12] Projects to implement many other languages were started, including PHP, Python, and Ruby; along with esoteric and demonstration languages such as Befunge and the "squaak" tutorial language.[13] None of these projects were successful in becoming the primary implementation of their respective languages.[4]

Internals[edit]

There are three forms of program code for Parrot:

Examples[edit]

Registers[edit]

Parrot is register-based like most hardware CPUs, and unlike most virtual machines, which are stack-based. Parrot provides four types of registers:

Parrot provides an arbitrary number of registers; this number is fixed at compile time per subroutine.

Arithmetic operations[edit]

In PASM

    set I1, 4
    inc I1        # I1 is now 5
    add I1, 2     # I1 is now 7
    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 "\n"
    end

In PIR

 .sub 'main' :main
    $I1 = 4
    inc $I1     # $I1 is now 5
    $I1 += 2    # $I1 is now 7
    $N1 = 42.0
    dec $N1     # $N1 is now 41.0
    $N1 -= 2.0  # $N1 now 39.0
    print $I1
    print ', '
    print $N1
    print "\n"
 .end

See also[edit]

References[edit]

  1. ^ a b "New supported release 8.1.0 "Andean Parakeet"". Parrot Foundation. 2016-02-16. Retrieved 2016-09-26.
  • ^ "Parrot Contributor License Agreement 1.0" (PDF). Parrot Foundation. Archived from the original (PDF) on 2010-08-16. Retrieved 2009-03-18.
  • ^ "Parrot Roadmap". Parrot Foundation. 2008-11-20. Archived from the original on 2010-04-15. Retrieved 2008-11-20.
  • ^ a b "Inactive Parrot | Parrot VM". www.parrot.org.
  • ^ "The Story Behind the Parrot Prank - O'Reilly Media". Oreilly.com. 2001-04-06. Retrieved 2014-02-25.
  • ^ "Programming Parrot". Perl.com. Archived from the original on 2010-07-18. Retrieved 2014-02-25.
  • ^ "Corporations Advanced Search". Washington State Department of Licensing. UBI 602 839 536. Retrieved 2021-04-09.
  • ^ Announcing the Parrot Foundation Archived June 29, 2008, at the Wayback Machine
  • ^ "Parrot 6.1.0 - Parrot Design Documents (PDDs)". Docs.parrot.org. Retrieved 2014-02-25.
  • ^ Otto, Christoph (2010-10-21). "reparrot: Parrot has a new architect. What now?". Reparrot.blogspot.com. Retrieved 2014-02-25.
  • ^ [1] Archived May 9, 2009, at the Wayback Machine
  • ^ "Languages - Parrot VM". parrot.org. Retrieved 2023-11-18.
  • ^ "Languages – Parrot". Parrot development wiki. Retrieved 2023-11-18.
  • ^ "The Parrot Bytecode (PBC) Format - parrotcode". Archived from the original on 2008-12-24. Retrieved 2009-07-15.
  • ^ [2] Archived July 20, 2009, at the Wayback Machine
  • External links[edit]


    Retrieved from "https://en.wikipedia.org/w/index.php?title=Parrot_virtual_machine&oldid=1226218065"

    Categories: 
    Cross-platform software
    Free compilers and interpreters
    Free software programmed in C
    Perl
    Register-based virtual machines
    Software using the Artistic license
    Discontinued software
    Hidden categories: 
    Webarchive template wayback links
    Wikipedia articles in need of updating from August 2022
    All Wikipedia articles in need of updating
    Articles with short description
    Short description is different from Wikidata
    All articles with unsourced statements
    Articles with unsourced statements from November 2023
    Official website different in Wikidata and Wikipedia
     



    This page was last edited on 29 May 2024, at 07:52 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki