Panagiotis Beglitis and Parrot virtual machine: Difference between pages

From Wikipedia, the free encyclopedia
(Difference between pages)
Content deleted Content added
FlaBot (talk | contribs)
m robot Adding: ro:Panagiotis Beglitis
 
m Quick-adding category "Cross-platform software" (using HotCat)
 
Line 1: Line 1:
{{Refimprove|date=February 2008}}
'''Panagiotis Beglitis''' (b. [[25 February]] [[1958]], [[Corinth]]) is a [[Greece|Greek]] politician, who from 2004-7 was [[Member of the European Parliament]] for the [[Panhellenic Socialist Movement]]; part of the [[Party of European Socialists]].
{{beta software}}
{{ infobox software
| name = Parrot virtual machine
| logo =
| developer =
| latest release version = 0.7.1
| latest release date = {{release date|2008|09|16}}
| operating system = [[Cross-platform]]
| genre = [[virtual machine]]
| license = [[Artistic License]] 2.0
| website = http://www.parrotcode.org/
}}
'''Parrot''' is a [[processor register|register]]-based [[virtual machine]] being developed using the [[C (programming language)|C programming language]] and intended to run [[dynamic language]]s efficiently. It uses [[just-in-time compilation]] for speed to reduce the interpretation overhead. It is currently possible to compile [[Parrot assembly language]] and [[Parrot intermediate representation|PIR]] (an intermediate language) to Parrot bytecode and execute it.


Parrot was started by the [[Perl]] community, and is developed with help from the [[open source]] and [[free software]] communities. As a result, it is focused on [[license compatibility]] ([[Artistic License|Artistic License 2.0]]), platform compatibility across a broad array of systems, processor architectures compatibility across most modern processors, speed of execution, small size (around 700k depending on platform), and being flexible enough to handle the varying demands of Perl, and most, if not all, other modern [[dynamic language]]s. It is also focusing on improving [[introspection (computer science)|introspection]], [[debugger]] capabilities, and compile-time semantic modulation.
In the [[2007 Greek legislative election]] he was elected to the [[Greek Parliament]] for [[Corinthia]], and consequently resigned from the [[European Parliament]].


==History==
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 (programming language)|Python]] and [[Perl]] [http://www.oreilly.com/news/parrotstory_0401.html]. The name was later adopted by this project, which aims to support Perl and Python.


Several languages are being developed along with it which target the Parrot virtual machine.
{{MEP-stub}}
{{Greece-politician-stub}}


The current version of the project is 0.7.1, codenamed "''Manu Aloha''", [http://www.parrotcode.org/news/2008/Parrot-0.7.1.html released] [[2008-09-16]].
{{DEFAULTSORT:Beglitis, Panagiotis }}
[[Category:1958 births|Beglitis, Panagiotis]]
[[Category:Living people|Beglitis, Panagiotis]]
[[Category:Members of the European Parliament from Greece|Beglitis, Panagiotis]]
[[Category:Panhellenic Socialist Movement politicians]]
[[Category:Greek MPs 2007-]]


Previous version's release dates are documented on Parrot's website[http://www.parrotcode.org/docs/parrothist.html].
[[ro:Panagiotis Beglitis]]

The Parrot Foundation has been recently created 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.[http://www.parrotblog.org/2008/06/announcing-parrot-foundation.html] As with the Parrot design documents, the bylaws and articles of incorporation were drafted on the mailing list and in the wiki.

==Languages==
The goal of the Parrot virtual machine is to host client languages, and allow interoperation between them. Several hurdles exist in accomplishing this goal, in particular the difficulty of mapping high-level concepts between languages and providing interoperability of data and data structures.

===Static and dynamic languages===
The differing properties of [[Type system#Static and dynamic typing|statically and dynamically typed]] languages have motivated the design of Parrot. Current popular virtual machines such as the [[Java virtual machine]] and the [[Common Language Runtime]] 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 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 so that it will run bytecode at speeds closer to machine code.

===Functional concepts===
Parrot has rich support for a number of 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]]. Approaching such problems at the level of the virtual machine and solving them only once thus offers a tremendous saving of effort when implementing them in any of Parrot's 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]] which includes the [[Parser Grammar Engine]] (PGE), a hybrid parser-generator that can express a [[recursive descent parser]] as well as a [[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.

===Existing client languages===
Besides [[Perl 6]], an increasing number of languages have partial or complete implementations including [[APL programming language|APL]], [[BASIC programming language|BASIC]], [[Befunge]], [[Chitchat programming language|Chitchat]], [[Cola programming language|Cola]], [[ECMAScript]], [[Forth (programming language)|Forth]], [[Jako (programming)|Jako]], [[Lisp programming language|Lisp]], [[Lua (programming language)|Lua]], [[M4 (computer language)|m4]], [[Miniperl]], [[OpenComal]], [[PHP]], [[Plot programming language|Plot]], [[Pheme]], [[Punie]], [[Python (programming language)|Python]], [[Ruby programming language|Ruby]], [[Scheme (programming language)|Scheme]], [[Squaak]], [[Tcl]] (aka partcl), [[URM programming language|URM]], [[YAL (programming language)|YAL]], and [[Z-machine|Z-code]]. However, several of these language implementations are currently incomplete or experimental.

===Possible future languages and projects===
There is interest in parts of the Ruby community.{{Fact|date=February 2008}} The Python community is taking more of a wait-and-see attitude,{{Fact|date=February 2008}} due to already having [[Psyco]], a [[just-in-time compilation|just-in-time]] Python-to-machine-code compiler, [[Jython]], a Python-to-Java-bytecode compiler, and [[IronPython]] to compile to the [[.NET Framework|.NET]] platform, as well as the in-development [[PyPy]], a rewrite of Python in Python itself aimed to provide static code generation as well as high-level optimization.

==Internals==
Parrot code has three forms. ''Bytecode'' is natively interpreted by Parrot. ''[[Parrot Assembly Language]]'' (PASM) is the low level language that compiles down to bytecode. ''[[Parrot intermediate representation|Parrot Intermediate Representation]]'' (PIR) is a slightly higher level language than PASM and also compiles down to ''Bytecode''. It is the primary target of language implementations. PIR transparently manages Parrot's inter-routine calling conventions, provides improved syntax, register allocation, and more. PIR code is usually stored in files with the suffix ".pir".

==Examples==
===Registers===
Parrot is register-based like most hardware [[Central processing unit|CPUs]], unlike most virtual machines, which are stack-based. Parrot provides four types of registers:

* I: native [[integer]] type
* N: [[floating point|floating-point]] numbers
* S: advanced [[String (computer science)|string]] registers with [[Unicode]] support
* P: PMC, or ''Parrot Magic Cookie'' &mdash; Parrot object type

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

===Arithmetic operations===

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

==Culture==

The tagline of the Parrot project is "''one bytecode to rule them all''," a reference to [[J. R. R. Tolkien|Tolkien]]'s [[One Ring]] from ''[[The Hobbit]]'' and ''[[The Lord of the Rings]]''.

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, is now the chief architect.

Development discussions take place primarily on the parrot-porters mailing list, hosted by perl.org. In addition, there are weekly moderated meetings for Parrot and language developers hosted in #parrotsketch on irc.perl.org. The #parrot channel on the same network is often full of Parrot hackers.

Design discussions exist in the form of Parrot Design Documents, or PDDs, in the Parrot repository [http://www.parrotcode.org/docs/pdd/]. The chief architect or another designated designer produces these documents to explain the philosophy of a feature as well as its interface and design notes. Parrot hackers turn these documents into executable tests, and then existing features.

The Parrot team releases a new stable version of the software on the third Tuesday of every month. Core committers take turns producing releases in a revolving schedule, where no single committer is responsible for multiple releases in a row. This practice has improved the project's velocity and stability.

==License==
Parrot is a [[free software]] project, distributed under the terms [[Artistic License]] Version 2.0.

== See also ==
{{portal|Free software|Free Software Portal Logo.svg}}

* [[Common Language Runtime]]
* [[Java virtual machine]]
* [[Low Level Virtual Machine]]
* [[mod_parrot]]

==External links==
* [http://www.parrotcode.org/ Parrot homepage]
* [http://perl6.cz/wiki/Perl_6_and_Parrot_links Perl 6 and Parrot links]

[[Category:Perl]]
[[Category:Virtual machines]]
[[Category:Free compilers and interpreters]]
[[Category:Cross-platform software]]

[[de:Parrot]]
[[es:Máquina virtual Parrot]]
[[fr:Parrot (machine virtuelle)]]
[[it:Parrot]]
[[nl:Parrot virtual machine]]
[[ja:Parrot]]
[[pl:Parrot]]
[[pt:Parrot]]
[[ru:Parrot]]

Revision as of 22:22, 10 October 2008

Template:Beta software

Parrot virtual machine
Stable release
0.7.1 / September 16, 2008 (2008-09-16)
Repository
Operating systemCross-platform
Typevirtual machine
LicenseArtistic License 2.0
Websitehttp://www.parrotcode.org/

Parrot is a register-based virtual machine being developed using the C programming language and intended to run dynamic languages efficiently. It uses just-in-time compilation for speed to reduce the interpretation overhead. It is currently possible to compile Parrot assembly language and PIR (an intermediate language) to Parrot bytecode and execute it.

Parrot was started by the Perl community, and is developed with help from the open source and free software communities. As a result, it is focused on license compatibility (Artistic License 2.0), platform compatibility across a broad array of systems, processor architectures compatibility across most modern processors, speed of execution, small size (around 700k depending on platform), and being flexible enough to handle the varying demands of Perl, and most, if not all, other modern dynamic languages. It is also focusing on improving introspection, debugger capabilities, and compile-time semantic modulation.

History

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 [1]. The name was later adopted by this project, which aims to support Perl and Python.

Several languages are being developed along with it which target the Parrot virtual machine.

The current version of the project is 0.7.1, codenamed "Manu Aloha", released 2008-09-16.

Previous version's release dates are documented on Parrot's website[2].

The Parrot Foundation has been recently created 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.[3] As with the Parrot design documents, the bylaws and articles of incorporation were drafted on the mailing list and in the wiki.

Languages

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

Static and dynamic languages

The differing properties of statically and dynamically typed languages have motivated the design of Parrot. Current popular virtual machines such as the Java virtual machine and the Common Language Runtime 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 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 so that it will run bytecode at speeds closer to machine code.

Functional concepts

Parrot has rich support for a number of 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. Approaching such problems at the level of the virtual machine and solving them only once thus offers a tremendous saving of effort when implementing them in any of Parrot's client languages.

Compiler tools

Parrot provides a suite of compiler-writing tools which includes the Parser Grammar Engine (PGE), a hybrid parser-generator that can express a recursive descent parser as well as a 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.

Existing client languages

Besides Perl 6, an increasing number of languages have partial or complete implementations including APL, BASIC, Befunge, Chitchat, Cola, ECMAScript, Forth, Jako, Lisp, Lua, m4, Miniperl, OpenComal, PHP, Plot, Pheme, Punie, Python, Ruby, Scheme, Squaak, Tcl (aka partcl), URM, YAL, and Z-code. However, several of these language implementations are currently incomplete or experimental.

Possible future languages and projects

There is interest in parts of the Ruby community.[citation needed] The Python community is taking more of a wait-and-see attitude,[citation needed] due to already having Psyco, a just-in-time Python-to-machine-code compiler, Jython, a Python-to-Java-bytecode compiler, and IronPython to compile to the .NET platform, as well as the in-development PyPy, a rewrite of Python in Python itself aimed to provide static code generation as well as high-level optimization.

Internals

Parrot code has three forms. Bytecode is natively interpreted by Parrot. Parrot Assembly Language (PASM) is the low level language that compiles down to bytecode. Parrot Intermediate Representation (PIR) is a slightly higher level language than PASM and also compiles down to Bytecode. It is the primary target of language implementations. PIR transparently manages Parrot's inter-routine calling conventions, provides improved syntax, register allocation, and more. PIR code is usually stored in files with the suffix ".pir".

Examples

Registers

Parrot is register-based like most hardware CPUs, 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

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

Culture

The tagline of the Parrot project is "one bytecode to rule them all," a reference to Tolkien's One Ring from The Hobbit and The Lord of the Rings.

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, is now the chief architect.

Development discussions take place primarily on the parrot-porters mailing list, hosted by perl.org. In addition, there are weekly moderated meetings for Parrot and language developers hosted in #parrotsketch on irc.perl.org. The #parrot channel on the same network is often full of Parrot hackers.

Design discussions exist in the form of Parrot Design Documents, or PDDs, in the Parrot repository [4]. The chief architect or another designated designer produces these documents to explain the philosophy of a feature as well as its interface and design notes. Parrot hackers turn these documents into executable tests, and then existing features.

The Parrot team releases a new stable version of the software on the third Tuesday of every month. Core committers take turns producing releases in a revolving schedule, where no single committer is responsible for multiple releases in a row. This practice has improved the project's velocity and stability.

License

Parrot is a free software project, distributed under the terms Artistic License Version 2.0.

See also

External links