The Parrot VM                                    (40’)

Its goals and challenges for dynamic languages




     François P...
About Me
            Parrot-porter since Oct 2005
            In the TOP 10 of committers
            Releaser Manager of ...
About Parrot VM
           a Virtual Machine started in 2001 …
           targets dynamic languages
               multi p...
About commodity
             commodity (*) is some good for which
             there is demand, but which is
             ...
About commoditization
            commoditization (*) is the process by which
            goods that have economic value a...
A stack of commodities
           My Web App




           fperrad@OSDC.fr2009




                                 6
A stack of commodities
                                  My Web App




                                   Hardware


    ...
A stack of commodities
                                 My Web App




                             Operating System



  ...
A stack of commodities
                                     My Web App



                               Web Framework



...
A stack of commodities
                                   My Web App



                                 Web Framework



...
Dynamic languages grow




                                  fperrad@OSDC.fr2009




Not yet majority


But dynamic/static...
C/C+ implementation
         PHP          PHP 4.x, PHP 5.x

         VisualBasic -
         Perl        Perl 5.8, Perl 5.1...
JVM implementation
         PHP              -
         Perl             -
         Python           JPython 2.5

        ...
.NET/mono implementation
PHP          Phalanger

VisualBasic VB.NET
Perl         -
Python       IronPython

JavaScript   J...
Challenges

            Languages must move on VM
               Initial C implementation is just a prototyp or a
        ...
Conditions for success
 Official Specifications (vs reference
 implementation)
      rubyspec.org/ (Rubinius)
      perlca...
Features for HLL implementor
            Multiple runcore         (opcode interpreter)
                   switch, C goto, ...
Features for HLL implementor
           PIR – Parrot Intermediate Representation
                  the interface of Parrot...
Roadmap : some milestones
          2005 : PGE
          Jan 2008 : NQP availability
              Start of Rakudo dev.
  ...
Roadmap : next milestones
            ??? : Plumage – Module ecosystem
               trac.parrot.org/parrot/wiki/ModuleEc...
Bibliography / Webography
 www.parrot.org
 trac.parrot.org
 F. Elie, Économie du logiciel libre, Eyrolles
 Virtual Machine...
"one bytecode to rule them all"




                                                              fperrad@OSDC.fr2009
   C...
Upcoming SlideShare
Loading in...5
×

The Parrot VM

3,587

Published on

Its goals and challenges for dynamic languages.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,587
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
27
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • Hobby : compiler writer Not in core, but in languages ie user side Check the goal of Parrot : not only a VM for Perl6
  • CLR : Common Language Runtime DLR : Dynamic Language Runtime JSR : Java Specification Request JSR 292 : Supporting Dynamically Typed Languages on the Java Platform
  • Now, do some Marketing Not the best product, just enougt until the next technological breakthrough.
  • Industrial & FOSS objectives
  • In 1985, IBM commodotizes the Personal Computer Open Spec => compatible Harware : under control with Intel 8086 Software : forget with Microsoft DOS Apple survives in niche
  • With Moore Law, x86 becomes server Unix guys dislike i386 The winner is Linux, distributed FOSS development. MS Windows (proprietary) is on Desktop.
  • Only FOSS actors, but 2 flavors : OW2 & Apache Fondation : consortium (R&D mutualisation), Java Dynamic languages (geek) : Catalyst (Perl), Rails (Ruby),
  • .NET CLR/DLR & mono JVM Parrot frequency grow is ended, Moore Law deals now with Multi core processor
  • Not yet majority But dynamic/static ratio moves from 30-70% to 40-60% In the following slides, I sort languages by their rank on TIOBE (Sept 2009) 3. PHP 5. VB.NET 6. Perl 8. Python 9. JavaScript 10. Ruby 19. Lua
  • Excludes all bridge
  • No VB.NET & never Groovy new entrant, and a special case : targets only JVM
  • Jython example : - targets last CPython - targets CPython modules - targets JVM, just a script language with access to Java objet/classe/framework Groovy has not this kind of dilemme.
  • FFI : Foreign function interface
  • PGE is a recursive descent parser + operator precedence NQP is a subset of Perl6 As example, the core of Lua on Parrot is only 4 KLOC
  • Development based on monthly release
  • Plumage : - metadata search - handles dependencies - install modules
  • Credit : http://img-fan.theonering.net/rolozo/images/verger/PICT1619.JPG
  • The Parrot VM

    1. 1. The Parrot VM (40’) Its goals and challenges for dynamic languages François Perrad francois.perrad@gadz.org fperrad@OSDC.fr2009 1
    2. 2. About Me Parrot-porter since Oct 2005 In the TOP 10 of committers Releaser Manager of Parrot 1.1.0 Packager for Windows (with mingw) http://sourceforge.net/projects/parrotwin32/ ~1 daily build on Smolder Mostly a HLL implementor Lua WMLScript (bytecode translator) Markdown … fperrad@OSDC.fr2009 Hobby : compiler writer Not in core, but in languages ie user side Check the goal of Parrot : not only a VM for Perl6 2
    3. 3. About Parrot VM a Virtual Machine started in 2001 … targets dynamic languages multi paradigm : functional, OO, … Register based (not stack based) Continuation Passing Style (CPS) allows interoperability between HLL (High Level Language) reuse components a great environment for HLL implementor Visible side effects CLR/DLR JSR 292 fperrad@OSDC.fr2009 CLR : Common Language Runtime DLR : Dynamic Language Runtime JSR : Java Specification Request JSR 292 : Supporting Dynamically Typed Languages on the Java Platform 3
    4. 4. About commodity commodity (*) is some good for which there is demand, but which is supplied without qualitative differentiation across a market An example generic pharmaceuticals the interest for customers is lower prices (*) : Source Wikipedia fperrad@OSDC.fr2009 Now, do some Marketing Not the best product, just enougt until the next technological breakthrough. 4
    5. 5. About commoditization commoditization (*) is the process by which goods that have economic value and are distinguishable in terms of attributes (uniqueness or brand) end up becoming simple commodities in the eyes of the market or consumers. An example : Eclipse IDE IBM gives/opens its codebase the IDE market disappears competitors die or survive in niche segment a new market : plugins for Eclipse Who is best placed in this market ? Who controls the Eclipse roadmap ? (*) : Source Wikipedia fperrad@OSDC.fr2009 Industrial & FOSS objectives 5
    6. 6. A stack of commodities My Web App fperrad@OSDC.fr2009 6
    7. 7. A stack of commodities My Web App Hardware fperrad@OSDC.fr2009 In 1985, IBM commodotizes the Personal Computer -Open Spec => compatible -Harware : under control with Intel 8086 -Software : forget with Microsoft DOS Apple survives in niche 7
    8. 8. A stack of commodities My Web App Operating System Hardware : x86 fperrad@OSDC.fr2009 With Moore Law, x86 becomes server Unix guys dislike i386 The winner is Linux, distributed FOSS development. MS Windows (proprietary) is on Desktop. 8
    9. 9. A stack of commodities My Web App Web Framework Operating System : Linux Hardware : i386 fperrad@OSDC.fr2009 Only FOSS actors, but 2 flavors : OW2 & Apache Fondation : consortium (R&D mutualisation), Java Dynamic languages (geek) : Catalyst (Perl), Rails (Ruby), 9
    10. 10. A stack of commodities My Web App Web Framework Virtual Machine (Interpreter) Operating System : Linux Hardware : i386 – multi core fperrad@OSDC.fr2009 .NET CLR/DLR & mono JVM Parrot frequency grow is ended, Moore Law deals now with Multi core processor 10
    11. 11. Dynamic languages grow fperrad@OSDC.fr2009 Not yet majority But dynamic/static ratio moves from 30-70% to 40-60% In the following slides, I sort languages by their rank on TIOBE (Sept 2009) 3. PHP 5. VB.NET 6. Perl 8. Python 9. JavaScript 10. Ruby 19. Lua 11
    12. 12. C/C+ implementation PHP PHP 4.x, PHP 5.x VisualBasic - Perl Perl 5.8, Perl 5.10 Python CPython 2.6, CPython 3.1, Stackless, Psyco V2 (JIT), Unladen Swallow 2.6 (llvm) JavaScript SpiderMonkey, V8, … Ruby Ruby 1.8, Ruby 1.9 (YARV), Rubinius Lua Lua 5.1, LuaJIT 5.1 fperrad@OSDC.fr2009 Excludes all bridge 12
    13. 13. JVM implementation PHP - Perl - Python JPython 2.5 JavaScript Rhino Ruby JRuby 1.8 Lua Kahlua (J2ME) Scala Scala 2.7 Groovy Groovy 1.6 fperrad@OSDC.fr2009 No VB.NET & never Groovy new entrant, and a special case : targets only JVM 13
    14. 14. .NET/mono implementation PHP Phalanger VisualBasic VB.NET Perl - Python IronPython JavaScript JScript.NET Ruby IronRuby Lua - Scala ? fperrad@OSDC.fr2009 14
    15. 15. Challenges Languages must move on VM Initial C implementation is just a prototyp or a prove of concept Open Source resources are limited Efforts are duplicated in language in libraries binding in module & framework core language or full modules ? fperrad@OSDC.fr2009 Jython example : - targets last CPython - targets CPython modules - targets JVM, just a script language with access to Java objet/classe/framework Groovy has not this kind of dilemme. 15
    16. 16. Conditions for success Official Specifications (vs reference implementation) rubyspec.org/ (Rubinius) perlcabal.org/syn/ (Perl6) Official & huge Test Suite svn.pugscode.org/pugs/t/spec/ (Perl6) Mostly implements the language with the language itself codespeak.net/pypy/ (Python) User friendly policies for support, version, maintenance, … fperrad@OSDC.fr2009 16
    17. 17. Features for HLL implementor Multiple runcore (opcode interpreter) switch, C goto, profiler, … GC - Garbage Collection Exception mechanism Unicode support (ICU) PBC - a bytecode file format Dynamic PMC (PolyMorphic Container) build the HLL types as object as shared library Dynamic Opcode as shared library NCI - Native Call Interface a FFI mechanism fperrad@OSDC.fr2009 FFI : Foreign function interface 17
    18. 18. Features for HLL implementor PIR – Parrot Intermediate Representation the interface of Parrot an OO assembler, with rich calling convention 4 types : int, num, string, pmc PCT - Parrot Compiler Toolkit PGE – Parrot Grammar Engine parse the source produce an AST (Abtract Syntax Tree) NQP – Not Quite Perl describes action on AST HLLCompiler : base class for a compiler PIR generation from AST fperrad@OSDC.fr2009 PGE is a recursive descent parser + operator precedence NQP is a subset of Perl6 As example, the core of Lua on Parrot is only 4 KLOC 18
    19. 19. Roadmap : some milestones 2005 : PGE Jan 2008 : NQP availability Start of Rakudo dev. Mar 2009 : Parrot 1.0 API stable (with deprecation rules) Installable Languages leave the nest Jul 2009 : Parrot 1.4 refactoring fperrad@OSDC.fr2009 Development based on monthly release 19
    20. 20. Roadmap : next milestones ??? : Plumage – Module ecosystem trac.parrot.org/parrot/wiki/ModuleEcosystem gitorious.org/parrot-plumage/parrot-plumage Jan 2010 : Parrot 2.0 2010 Q1 : Rakudo Star a large subset of Perl6 usable in real world Updated roadmap trac.parrot.org/parrot/report/14 fperrad@OSDC.fr2009 Plumage : - metadata search - handles dependencies - install modules 20
    21. 21. Bibliography / Webography www.parrot.org trac.parrot.org F. Elie, Économie du logiciel libre, Eyrolles Virtual Machine Showdown: Stack Versus Registers The Structure and Performance of Efficient Interpreters How to not write Virtual Machines for Dynamic Languages fperrad@OSDC.fr2009 21
    22. 22. "one bytecode to rule them all" fperrad@OSDC.fr2009 Credit : http://img-fan.theonering.net/rolozo/images/verger/PICT1619.JPG Credit : http://img-fan.theonering.net/rolozo/images/verger/PICT1619.JPG 22

    ×