• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
The Parrot VM
 

The Parrot VM

on

  • 4,846 views

Its goals and challenges for dynamic languages.

Its goals and challenges for dynamic languages.

Statistics

Views

Total Views
4,846
Views on SlideShare
4,838
Embed Views
8

Actions

Likes
1
Downloads
26
Comments
0

2 Embeds 8

http://www.lmodules.com 5
http://www.linkedin.com 3

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • 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 The Parrot VM Document Transcript

  • The Parrot VM (40’) Its goals and challenges for dynamic languages François Perrad francois.perrad@gadz.org fperrad@OSDC.fr2009 1
  • 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
  • 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
  • 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
  • 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
  • A stack of commodities My Web App fperrad@OSDC.fr2009 6
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • .NET/mono implementation PHP Phalanger VisualBasic VB.NET Perl - Python IronPython JavaScript JScript.NET Ruby IronRuby Lua - Scala ? fperrad@OSDC.fr2009 14
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • "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