Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Parrot virtual machine
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Languages== 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 structure]]s between languages. ===Static and dynamic languages=== The differing properties of [[Type checking|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 machine|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]].{{cn|date=November 2023}} Other register-based virtual machines inspired parts of Parrot's design, including [[LLVM]], the [[Lua (programming language)#Internals|Lua VM]] and Inferno's [[Dis virtual machine|Dis]]. ==={{Anchor|PMC}}Functional concepts=== Parrot has rich support for several features of [[functional programming]] including [[Closure (computer science)|closures]] and [[continuation]]s, both of which can be particularly difficult to implement correctly and portably, especially in conjunction with [[exception handling]] and [[thread (computer science)|threading]]. The biggest advantage is the dynamic extendability of objects with methods, which allows for ''polymorphic containers'' (PMCs) and associated [[opcode]]s. Implementing solutions to these problems at the virtual machine level obviates the need to solve them in the individual client languages. ===Compiler tools=== {{Main|Parser Grammar Engine}} <!-- note: once [[Parrot compiler toolchain]] exists, that should be the main link --> Parrot provides a suite of [[Parrot compiler toolchain|compiler-writing tools]]<ref>[http://docs.parrot.org/parrot/latest/html/docs/book/ch04_compiler_tools.pod.html] {{webarchive|url=https://web.archive.org/web/20090509161210/http://docs.parrot.org/parrot/latest/html/docs/book/ch04_compiler_tools.pod.html|date=May 9, 2009}}</ref> 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=== The most complete language implementations targeting the Parrot VM were Raku (known at the time as Rakudo Perl 6), [[Lua (programming language)|Lua]] and a new language called "Winxed".<ref>{{cite web|url=http://www.parrot.org/languages|title=Languages - Parrot VM |publisher=parrot.org |access-date=2023-11-18}}</ref> Projects to implement many other languages were started, including [[PHP]], [[Python (programming language)|Python]], and [[Ruby (programming language)|Ruby]]; along with esoteric and demonstration languages such as [[Befunge]] and the "[[Wikibooks:Parrot Virtual Machine/Squaak Tutorial|squaak]]" tutorial language.<ref>{{cite web|url=https://trac.parrot.org/parrot/wiki/Languages |title=Languages β Parrot |publisher=Parrot development wiki |access-date=2023-11-18}}</ref> None of these projects were successful in becoming the primary implementation of their respective languages.<ref name="inactive-parrot" />
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)