•
•
•
•
•
•
TableofContents
Index
Reviews
ReaderReviews
Errata
Academic
Perl6andParrotEssentials,2ndEdition
ByAllisonRandal,DanSugalski,
LeopoldTötsch
Publisher :O'Reilly
PubDate :June2004
ISBN :0-596-00737-X
Pages :294
Thisbookisanunparalleledsneak-peekof
what'scominginthewidely-anticipatedPerl
6.Ituncoversgroundbreakingnew
developmentsinParrot--theinterpreter
enginethatwillexecutecodewritteninthe
newPerl6languageandthemost
revolutionarychangeinthelanguageitself-Apocalypse12onobjects.Italsoincludes
expandedcoverageofApocalypse5(regular
expressions)andApocalypse6(subroutines).
•
•
•
•
•
•
TableofContents
Index
Reviews
ReaderReviews
Errata
Academic
Perl6andParrotEssentials,2ndEdition
ByAllisonRandal,DanSugalski,
LeopoldTötsch
Publisher :O'Reilly
PubDate :June2004
ISBN :0-596-00737-X
Pages :294
Copyright
Preface
HowThisBookIsOrganized
FontConventions
UsingCodeExamples
We'dLiketoHearfromYou
Acknowledgments
Chapter1.ProjectOverview
Section1.1.TheBirthofPerl6
Section1.2.IntheBeginning...
Section1.3.TheContinuingMission
Chapter2.ProjectDevelopment
Section2.1.LanguageDevelopment
Section2.2.ParrotDevelopment
Chapter3.DesignPhilosophy
Section3.1.LinguisticandCognitiveConsiderations
Section3.2.ArchitecturalConsiderations
Chapter4.BasicSyntax
Section4.1.Variables
Section4.2.Operators
Section4.3.ControlStructures
Chapter5.Subroutines
Section5.1.UsingSubroutines
Section5.2.Parameters
Section5.4.SubroutineStubs
Section5.6.AnonymousSubroutines
Section5.8.CurriedSubroutines
Section5.10.LvalueSubroutines
Section5.3.Arguments
Section5.5.SubroutineScope
Section5.7.MultiSubroutines
Section5.9.WrappedSubroutines
Section5.11.Macros
Chapter6.Objects
Section6.1.UsingObjects
Section6.2.Classes
Section6.3.Roles
Section6.5.PrivateandPublic
Section6.7.Submethods
Section6.4.Delegation
Section6.6.Subroutines
Section6.8.MultipleDispatch
Chapter7.GrammarsandRules
Section7.1.UsingRules
Section7.2.BuildingBlocks
Section7.3.Modifiers
Section7.5.BacktrackingControl
Section7.4.Built-inRules
Section7.6.HypotheticalVariables
Chapter8.ParrotInternals
Section8.1.CoreDesignPrinciples
Section8.2.Parrot'sArchitecture
Section8.3.TheInterpreter
Section8.4.I/O,Events,andThreads
Section8.6.AdvancedFeatures
Section8.5.Objects
Section8.7.Conclusion
Chapter9.ParrotAssemblyLanguage
Section9.1.GettingStarted
Section9.2.Basics
Section9.3.WorkingwithPMCs
Section9.5.StacksandRegisterFrames
Section9.7.Subroutines
Section9.9.Events
Section9.11.LoadingBytecode
Section9.4.FlowControl
Section9.6.LexicalsandGlobals
Section9.8.ExceptionsandExceptionHandlers
Section9.10.Threads
Section9.12.ClassesandObjects
Section9.13.WritingTests
Chapter10.ParrotIntermediateRepresentation
Section10.1.Statements
Section10.2.VariablesandConstants
Section10.4.Labels
Section10.6.Subroutines
Section10.3.SymbolOperators
Section10.5.FlowControl
Section10.7.Methods
Chapter11.ParrotReference
Section11.1.PASMOpcodes
Section11.2.PIRDirectives
Section11.3.PIRInstructions
Section11.4.ParrotCommand-LineOptions
Colophon
Index
Copyright©2004,2003O'ReillyMedia,Inc.
PrintedintheUnitedStatesofAmerica.
PublishedbyO'ReillyMedia,Inc.,1005GravensteinHighway
North,Sebastopol,CA95472.
O'Reillybooksmaybepurchasedforeducational,business,or
salespromotionaluse.Onlineeditionsarealsoavailablefor
mosttitles().Formoreinformation,
contactourcorporate/institutionalsalesdepartment:(800)
998-9938or
NutshellHandbook,theNutshellHandbooklogo,andthe
O'ReillylogoareregisteredtrademarksofO'ReillyMedia,Inc.
Perl6andParrotEssentials,theimageofanaoudad,and
relatedtradedressaretrademarksofO'ReillyMedia,Inc.
Manyofthedesignationsusedbymanufacturersandsellersto
distinguishtheirproductsareclaimedastrademarks.Where
thosedesignationsappearinthisbook,andO'ReillyMedia,Inc.
wasawareofatrademarkclaim,thedesignationshavebeen
printedincapsorinitialcaps.
Whileeveryprecautionhasbeentakeninthepreparationofthis
book,thepublisherandauthorsassumenoresponsibilityfor
errorsoromissions,orfordamagesresultingfromtheuseof
theinformationcontainedherein.
Preface
Thereisnothingasscarytotheaverageprogrammer(tothe
averagehuman,really)asthesingleword"change."Change
meanstakingthetimetolearnanewwayofdoingthings.
Changescanbeannoying:movingtoanewhome,findingthe
shelvesreorganizedatyourneighborhoodcomputerstore,or
orderingyourfavoritebeeratyourfavoritepubonlytobetold
theydon'tmakeitanymore.Butchangescanalsobegood:a
vacationonthebeach,apromotion,araise,findingtheperfect
shortcuttoworkthatshaves20minutesoffyourcommute.This
bookisallaboutchange...thegoodkind.
Perl6isn'tfarenoughalongtosupportabookonthelevelof
ProgrammingPerl.However,asdevelopmentgoeson,we've
foundthattheaccumulatedloreofthepastfewyearsisquite
anentrybarrierfornewpeople.Thisbookisasnapshotofthe
currentstatus,designedtoeasethatfirststep.Itcoversthe
projectthroughApocalypse12andthe0.1.0releaseofParrot.
Weexpectthatthiswillbethelasteditionofthebook,butwe
willpublishupdatesasneeded.
HowThisBookIsOrganized
Thisbookhas11chapters:
Chapter1isahigh-leveloverviewoftheproject,withsome
historyofhowandwhytheprojectwasstarted.
Chapter2providesmoredetailonlifecycleswithintheproject
andhowtogetinvolved.
Chapter3explainssomeoftheprinciplesbehindPerl6design
work.
Chapter4-Chapter7areanintroductiontoPerl6syntax.
Chapter8explainstheoverallarchitectureofParrot(thevirtual
machinethatrunsPerl6).
Chapter9isanintroductiontoParrotassemblylanguage.
Chapter10isanintroductiontoParrotintermediate
representation.
Chapter11isareferenceforParrotassemblylanguage,Parrot
intermediaterepresentation,andcommand-lineoptionsforthe
Parrotinterpreter.
Ifyou'reaPerlprogrammerwhoiscompletelynewtoPerl6,
you'llbeinterestedinthisbooktogetanideaofwhatit'llbe
liketoworkwithPerl6,whywe'remakingthechangeswe're
making,andhowtheprojectisgoing.You'llwanttoreadthe
firstsevenchapters.Ifyouthinkyoumightbeinterestedin
gettinginvolvedinimplementation,readtherestaswell.
Ifyou'realreadyinvolvedinthePerl6project,you'llbe
interestedinthisbooktoseehowallthepiecesfittogether,and
youmaywanttouseitasareferencewhileyou'reworking.If
you'vebeeninvolvedonlyonthelanguagesideortheinternals
side,you'llalsogetachancetoseewhattheotherhalfis
doing.Inthisway,theentirebookisrelevanttoyou.
Ifyou'reinterestedinimplementinganotherlanguageontopof
Parrot,you'llwanttoskimthroughtheParrotinformationin
Chapter2,andthenskipstraighttoChapter8andgofrom
there.
Ifyou'renotinvolvedinPerlbutjustwanttoseewhatthe"Perl
6"buzzisallabout,you'llwanttoreadChapter1,Chapter3,
andChapter8.You'llgetanoverviewofwhatwe'redoingand
why,withoutallthenitty-grittydetails.
FontConventions
Thefollowingfontconventionsareusedinthisbook:
Italic
Usedforfilenames,exampleURLs,andexampleemail
addresses
Constantwidth
Usedincodelistingsandforfunctionnames,variable
names,andotherliteraltext
Constantwidthitalic
Showstextthatshouldbereplacedwithuser-supplied
values
UsingCodeExamples
Thisbookisheretohelpyougetyourjobdone.Ingeneral,you
mayusethecodeinthisbookinyourprogramsand
documentation.Youdonotneedtocontactusforpermission
unlessyou'rereproducingasignificantportionofthecode.For
example,writingaprogramthatusesseveralchunksofcode
fromthisbookdoesnotrequirepermission.Sellingor
distributingaCD-ROMofexamplesfromO'Reillybooksdoes
requirepermission.Answeringaquestionbycitingthisbook
andquotingexamplecodedoesnotrequirepermission.
Incorporatingasignificantamountofexamplecodefromthis
bookintoyourproduct'sdocumentationdoesrequire
permission.
Weappreciate,butdonotrequire,attribution.Anattribution
usuallyincludesthetitle,author,publisher,andISBN.For
example:"Perl6andParrotEssentials,SecondEdition,by
AllisonRandal,DanSugalski,andLeopoldTötsch.Copyright
2004O'ReillyMedia,Inc.,0-596-00737-X."
Ifyoufeelyouruseofcodeexamplesfallsoutsidefairuseor
thepermissiongivenabove,feelfreetocontactusat
We'dLiketoHearfromYou
Pleaseaddresscommentsandquestionsconcerningthisbookto
thepublisher:
O'ReillyMedia,Inc.
1005GravensteinHighwayNorth
Sebastopol,CA95472
(800)998-9938(intheUnitedStatesorCanada)
(707)829-0515(internationalorlocal)
(707)829-0104(fax)
Wehaveawebpageforthisbook,wherewelisterrata,
examples,oranyadditionalinformation.Youcanaccessthis
pageat:
/>Tocommentorasktechnicalquestionsaboutthisbook,send
emailto:
Formoreinformationaboutourbooks,conferences,Resource
Centers,andtheO'ReillyNetwork,seeourwebsiteat:
Acknowledgments
Manythankstoourreviewersforthiseditionofthebook:Leon
Brocard,PiersCawley,DamianConway,chromatic,JeffreyDik,
SimonGlover,GarrettGoebel,TreyHarris,GregorPurdy,
JérômeQuelin,JensRieks,BrentRoyal-Gordon,JosephRyan,
HugovanderSanden,andMelvinSmith.
ThisbookisdedicatedtothePerlcommunity,becauseit
wouldn'texistwithoutthem.
Chapter1.ProjectOverview
Perl6isthenextmajorversionofPerl.It'sacompleterewrite
oftheinterpreter,andasignificantupdateofthelanguage
itself.ThegoalofPerl6istoaddsupportformuch-needednew
features,andstillbecleaner,faster,andeasiertouse.
ThePerl6projectisvastandcomplex,butitisn'tcomplicated.
Theprojectrunsonasimplestructurewithverylittle
managementoverhead.That'sreallytheonlywayitcouldrun.
Theprojectdoesn'thavehugecashortimeresources.Itsonly
resourceisthepeoplewhobelieveintheprojectenoughto
spendtheiroff-hourstheir"relaxation"timeworkingtoseeit
completed.Thischapterisasmuchaboutpeopleasitisabout
Perl.
1.1TheBirthofPerl6
BackonJuly18,2000,theseconddayofthefourthPerl
Conference(TPC4),asmallbandofPerlgeeksgatheredto
prepareforameetingofthePerl5Porterslaterthatday.The
topicathandwasthecurrentstateofthePerlcommunity.Four
monthshadpassedsincethe5.6.0releaseofPerl,andalthough
itintroducedsomeimportantfeatures,nonewererevolutionary.
Therehadbeenverylittleforwardmovementintheprevious
year.ItwasgenerallyacknowledgedthatthePerl5codebase
hadgrowndifficulttomaintain.Atthesametime,infightingon
theperl5-porterslisthadgrownsointensethatsomeofthe
bestdevelopersdecidedtoleave.Itwastimeforachange,but
noonewasquitesurewhattodo.Theystartedconservatively
withplanstochangetheorganizationofPerldevelopment.
Anhourintothediscussion,aroundthetimemostpeoplenod
offinanymeeting,JonOrwant(thereserved,universally
respectededitorofthePerlJournal)steppedquietlyintothe
roomandsnappedeveryonetoattentionwithanentirely
uncharacteristicandwell-plannedgesture.Smash!Acoffee
mughitthewall."Weare*@$!-ed(Crash!)unlesswecan
comeupwithsomethingthatwillexcitethecommunity(Pow!),
becauseeveryone'sgettingboredandgoingoffanddoingother
things!(Bam!)"(Atleast,that'sbasicallyhowLarrytellsit.Asis
usuallythecasewitheventslikethis,nooneremembers
exactlywhatJonsaid.)
Awakenedbythisdisplay,thegroupstartedtosearchforareal
solution.Thelanguageneededroomtogrow.Itneededthe
freedomtoevaluatenewfeatureswithouttheobscuringweight
oflegacycode.Thecommunityneededsomethingtobelievein,
somethingtogetexcitedabout.
WithinafewhoursthegroupsettledonPerl6,acomplete
rewriteofPerl.Theplanwasn'tjustalanguagechange,justan
implementationchange,orjustasocialchange.Itwasa
paradigmshift.Perl6wouldbethecommunity'srewriteofPerl,
andthecommunity'srewriteofitself.
WouldPerl6,particularlyPerl6asacompleterewrite,have
happenedwithoutthismeeting?Almostcertainly.Thesigns
appearedonthelists,inconferences,andinjournalsmonthsin
advance.Ifithadn'tstartedthatday,itwouldhavehappeneda
weeklater,orperhapsafewmonthslater,butitwouldhave
happened.Itwasastepthecommunityneededtotake.
1.2IntheBeginning...
Let'spauseandconsiderPerldevelopmentuptothatfateful
meeting.Perl6isjustanotherlinkinthechain.Themotivations
behinditandthedirectionsitwilltakearepartiallyguidedby
history.
Perlwasfirstdevelopedin1987byLarryWallwhilehewas
workingasaprogrammerforUnisys.Aftercreatinga
configurationandmonitoringsystemforanetworkthat
spannedthetwoAmericancoasts,hewasfacedwiththetaskof
assemblingusablereportsfromlogfilesscatteredacrossthe
network.Theavailabletoolssimplyweren'tuptothejob.A
linguistatheart,Larrysetouttocreatehisownprogramming
language,whichhecalledperl.Hereleasedthefirstversionof
PerlonDecember18,1987.Hemadeitfreelyavailableon
Usenet(thiswasbeforetheInternettookovertheworld,
remember),andquicklyacommunityofPerlprogrammers
grew.
TheearlyadoptersofPerlweresystemadministratorswhohad
hitthewallwithshellscripting,awk,andsed.However,inthe
mid-1990sPerl'saudienceexplodedwiththeadventoftheWeb,
asPerlwastailor-madeforCGIscriptingandotherweb-related
programming.
Meantime,thePerllanguageitselfkeptgrowing,asLarryand
otherskeptaddingnewfeatures.Probablythemost
revolutionarychangeinPerl(untilPerl6,ofcourse)wasthe
additionofmodulesandobject-orientedprogrammingwithPerl
5.AlthoughthismadethetransitionperiodfromPerl4toPerl5
unusuallylong,itbreathednewlifeintothelanguageby
providingamodern,modularinterface.BeforePerl5,Perlwas
consideredsimplyascriptinglanguage;afterPerl5,itwas
consideredafull-fledgedprogramminglanguage.
Larry,meanwhile,startedtakingabackseattoPerl
developmentandallowedotherstotakeresponsibilityfor
addingnewfeaturesandfixingbugsinPerl.ThePerl5Porters
(p5p)mailinglistbecamethecentralclearinghouseforbug
reportsandproposedchangestothePerllanguage,withthe
"pumpkinholder"(alsoknownasthe"pumpking")beingthe
programmerresponsibleforintegratingthepatchesand
distributingthemtotherestofthelistforreview.Larry
continuedtofollowPerldevelopment,butlikeaparent
determinednottosmotherhischildren,hestayedoutofthe
day-to-daydevelopment,limitinghisinvolvementtosituations
inwhichhewastrulyneeded.
AlthoughyoumightthinkthatthebirthofthePerl6project
wouldbethefirstnailinthecoffinforPerl5,that'sfarfromthe
case.Ifanything,Perl5hashadahugeresurgenceof
development,withPerl5.7.0releasedonlytwoweeksafterthe
initialdecisiontogoaheadwithPerl6.Perl5.8.0,aJuly2002
releasebypumpkingJarkkoHietaniemi,includesusable
Unicodesupport,aworkingthreadsinterface,safesignals,and
asignificantimprovementoftheinternalswithcodecleanup,
bugfixes,betterdocumentation,andmorethanquadrupled
testcoverage.5.8hasquarterlymaintenancereleasesthanks
topumpkingNicholasClark.The5.9-5.10releaseshaveHugo
vanderSandenasarchitectandRafaëlGarcia-Suarezas
pumpking.Plansforthosereleasesincludeenhancementsto
theregularexpressionengine,furtherinternalscleanupanda
"useperl6ish"pragmathatwillintegratemanyofthefeatures
ofPerl6.Perl5isactiveandthriving,andwillcontinuetobeso
evenafterthereleaseofPerl6.0.
1.3TheContinuingMission
Muchhaschangedsincetheearlydaysoftheproject.New
peoplejoinandothersleaveinaregular"changingofthe
guard"pattern.Planschangeastheworkprogresses,andthe
demandsoftheworkandtheneedsofthecommunitybecome
clearer.TodaythePerl6projecthastwomajorparts:language
designandinternals.Eachbranchisrelativelyautonomous,
thoughthereisahealthyamountofcoordinationbetween
them.
1.3.1LanguageDesign
AswithallthingsPerl,thecentralcommandofthelanguage
designprocessisLarryWall,thecreatorofthePerllanguage.
Larryissupportedbytherestofthedesignteam:Damian
Conway,AllisonRandal,DanSugalski,HugovanderSanden,
andchromatic.Wespeakinweeklyteleconferencesandalso
meetface-to-faceafewtimesayeartohashoutideasforthe
designdocuments,ortoworkthroughroadblocksstandingin
thewayofdesignorimplementation.Thedesignteamisa
diversegroup,includingprogrammers-for-hire,Perltrainers,
andlinguistswithabroadspectrumofinterestsand
experiences.Thisdiversityhasprovedquitevaluableinthe
designprocess,aseachmemberisabletoseeproblemsinthe
designorpotentialsolutionsthattheothermembersmissed.
1.3.1.1RequestsForComments(RFCs)
ThefirststepindesigningthenewlanguagewastheRFC
(RequestForComments)process.Thisspurredaninitialburst
ofcommunityinvolvement.AnyonewasfreetosubmitanRFC
onanysubject,whetheritwasassmallasaddinganoperator,
orasbigasreworkingOOsyntax.Mostoftheproposalswere
reallyquiteconservative.TheRFCsfollowedastandardformat
sotheywouldbeeasiertoreadandeasiertocompare.
EachRFCwassubjecttopeerreview,carriedoutinanintense
fewweeksaroundOctober2000.OnethingtheRFCprocess
demonstratedwasthatthePerlcommunitystillwasn'tquite
readytomovebeyondtheinfightingthathadcharacterizedPerl
5Portersearlierthatyear.[1]EventhoughfewRFCshavebeen
acceptedwithoutmodification,theprocessidentifiedalarge
numberofirritantsinthelanguage.Thesehaveservedas
signpostsforlaterdesignefforts.
[1]Mark-JasonDominuswroteanexcellentcritiqueoftheRFCprocess
(Itmayseemharshtopeopleaccustomed
tothemoreopenandtolerantcommunityoftoday,butit'sanaccuraterepresentationofthetime
whenitwaswritten.
1.3.1.2Apocalypses,Synopses,Exegeses
TheApocalypses,[2]Synopses,andExegeses[3]areanimportant
partofthedesignprocess.LarrystartedtheApocalypseseries
asasystematicwayofansweringtheRFCs.EachApocalypse
correspondstoachapterinhisbookProgrammingPerl,and
addressesthefeaturesinthechapterthatarelikelytochange.
[2]An"apocalypse"inthesenseof"revelation,"not"endoftheworld."
[3]An"exegesis"isanexplanationorinterpretationofatext.
However,theApocalypseshavebecomemuchmorethana
simpleresponsetoRFCs.Larryhasastartlingknackforlooking
at12solutionstoaproblem,pullingoutthegoodbitsfrom
eachone,andcombiningthemintoasolutionthatis10times
betterthananyoftheproposalsalone.TheApocalypsesarean
excellentexampleofthis"LarryEffect."Headdresseseach
relevantRFC,andgivesreasonswhyheacceptedorrejected
variouspiecesofit.ButeachApocalypsealsogoesbeyonda
simple"yes"and"no"responsetoattacktherootsofthe
problemsidentifiedintheRFCs.
TheSynopsesaresummariesofeachApocalypse.Theseactas
aquickreferenceforthecurrentstateofdesign,andaremore
approachablethantheoftenlengthyApocalypses.TheSynopsis
seriesdidn'tstartuntilApocalypse5,butLukePalmerisnow
workingontheretroactiveSynopses2-4.
DamianConway'sExegesesareextensionsofeachApocalypse.
TheExegesesarebuiltaroundpracticalcodeexamplesthat
applyandexplainthenewideas.
1.3.1.3Thep6lmailinglist
ThenextbodyofdesignworkisthePerl6Languagemailinglist
(),oftenfondlyreferredtoas"p6l."
PiersCawleywritesaweeklysummaryofallthePerl6mailing
lists.LukePalmerhasbeendeputizedasunofficialrefereeof
thelist.Heanswersquestionsthatdon'trequirethedirect
involvementofthedesignteamorthathavebeenanswered
before.Thelisthasapproximately40regularcontributorsin
anygivenmonth,aswellasalargenumberofoccasional
postersandlurkers.Somepeoplehaveparticipatedsincethe
verybeginning;othersappearforafewmonthsandmoveon.
Eventhoughtheindividualschange,thegeneraltoneofp6lis
thesame.It'sanopenforumforanyideasontheuser-visible
partsofPerl6.Inthetypicalpattern,onepersonpostsanidea
and5to10peoplerespondwithcriticismsorsuggestions.The
listperiodicallytravelsdownaspeculativethreadlikearunaway
train,buttheseeventuallyrunoutofsteam.ThenLarrypicks
outthegoldenbitsandgentlytellstherestthatno,henever
intendedPerl6tohaveneo-VulcanmechanoidScooby-Dooby-
doos.EvenwhenLarrydoesn'tpost,hefollowsthelistandthe
trafficservesasavaluablecatalystforhisthoughts.
1.3.2Internals
TheinternalsdevelopmentforPerl6fallstotheParrotproject.
TheheartofParrotisagrandioseideathatturnedouttobe
morerealisticthananyoneoriginallycouldhavebelieved:why
nothaveasingleinterpreterforseverallanguages?Unlikethe
parentPerl6project,whichwaslaunchedinasingleday,the
planforParrotformedinbitsandpiecesovertheperiodofa
year.
OnApril1,2001,SimonCozenspublishedanarticletitled
"ProgrammingParrot"asanAprilFools'joke
(Itwasa
contrivedinterviewwithLarryWallandGuidovanRossum
detailingtheirplanstomergePythonandPerlintoanew
languagecalledParrot.Afewmonthslater,whenPerl6
internalsbegantotakeanindependentpathwithinthelarger
project,theydubbedthesubproject"Parrot"inafittingturnof
lifeimitatingart.
EarlyStepsTowardPerl6Internals
TheearliestprogresstowardimplementingPerl6startedbeforethecurrent
incarnationofPerl6wasevenconceived.TheTopazproject,startedin1998,
wasspearheadedbyChipSalzenberg.ItwasareimplementationofPerl5
writteninC++.Theprojectwasabandoned,butmanyofthegoalsandintended
featuresforTopazwereadoptedforPerl6internals,andthedifficultiesTopaz
encounteredwerealsovaluableguides.
SapphirewasanotherearlyprototypethatinfluencedtheshapeofPerl6
internals.Itwasaone-weekprojectinSeptember2000.ThebrainchildofSimon
Cozens,SapphirewasanotherrewriteofPerl5internals.Itwasneverintended
forrelease,onlyasanexperimenttoseehowfartheideacouldgoinaweek,
andwhatlessonscouldbelearned.
TheplanforParrotwastobuildalanguage-neutralrun-time
environment.Itwouldsupportallthefeaturesofdynamic
languages,suchasPython,Ruby,Scheme,Befunge,and
others.ItwouldhavethreadingandUnicodesupport(twoof
themostproblematicfeaturestoaddintoPerl5code)designed
infromthestart.Itwouldsupportexceptionsandcompilation
tobytecode,andhavecleanextensionandembedding
mechanisms.
Thelanguage-neutralinterpreterwasoriginallyjustasideeffect
ofgooddesign.Keepingtheimplementationindependentofthe
syntaxwouldmakethecodecleanerandeasiertomaintain.
OnepracticaladvantageofthisdesignwasthatParrot
developmentcouldbegineventhoughthePerl6language
specificationwasstillinflux.
Thebiggerwininthelongterm,though,wasthatsinceParrot
wouldsupportthefeaturesofthemajordynamiclanguagesand
wasn'tbiasedtoaparticularsyntax,itcouldrunallthese
languageswithlittleadditionaleffort.It'sgenerally
acknowledgedthatdifferentlanguagesaresuitedtodifferent
tasks.Pickingwhichlanguagewillbeusedinalargesoftware
projectisacommonplanningproblem.There'sneveraperfect
fit.Itusuallyboilsdowntopickingthelanguagewiththemost
advantagesandtheleastnoticeabledisadvantages.Theability
toeasilycombinemultiplelanguageswithinaprojectcouldbea
hugebenefit.Usewell-testedlibrariesfromonelanguagefor
onetask.Takeadvantageofacleanwayofexpressinga
particularproblemdomaininasecond,withoutbeingforcedto
useitinareaswhereit'sweak.
Themodulardesignalsobenefitsfuturelanguagedesigners.
Insteadoftargetinglex/yaccandreimplementinglow-level
featuressuchasgarbagecollectionanddynamictypes,
designerscanwriteaparserthattargetstheParrotvirtual
machine.
DanSugalskileadstheParrotprojectaschiefarchitect,and
LeopoldTötschisthecurrentpumpking.TheParrotprojectis
largelyautonomous.Dancoordinateswiththerestofthedesign
teamtoensurethatParrotwillbeabletosupportthesemantics
Perl6willrequire,butthelanguagedesignershaveverylittle
inputintothedetailsofimplementation.Parrotisn'tdeveloped
solelyforPerl,butPerl6isentirelydependentonParrotitisthe
onlyinterpreterforPerl6.
ThecorecommunicationlinefortheParrotprojectisthe
mailinglist,,otherwiseknownas"
p6i."It'samuchmorebusiness-likelistthanp6l.Workflowin
Parrottakestheformofsubmittedpatches.Anyoneisfreeto
submitapatch,andcontributorswhoconsistentlysubmit
valuablepatchesoveralongperiodoftimearegrantedcheckinaccesstotheCVSrepository.
1.3.3Ponie
PonieisanimplementationofPerl5onParrot,startedinJuly
2003.Offically,Poniestandsfor"PerlOnNewInternalEngine."
Thenamewasoriginallyderivedfromarunninggaginthe
London.pmPerlMongersgroupwherethephrase"Iwanta
pony"appearedinlistsoffeaturerequestsforPerl(andother
unusualplaces).
Theproject,ledbyArturBergman,hastakenthePerl5source
codeasabaseandisgraduallyreplacingthecoreelements
withParrotequivalents.Legacycodewillbeoneofthebiggest
obstaclestoprojectsconsideringthemovefromPerl5toPerl6.
Fewcompanieshavetheresourcestodoacompleteupdateto
existingcodeeverytimeanewversionofthelanguageis
released.PonieoffersasmoothmigrationpaththatensuresPerl
5codewillfunctionaslongasit'sneeded.You'llevenbeableto
usePerl5modulesandPerl6modulesside-by-sideinthesame
program.ThecurrentplanisforPonietobethe5.14or5.16
releaseofPerl.
ThemailinglistforPoniedevelopmentis
1.3.4SupportingStructure
Last,butnotleast,isthegluethatholdstheprojecttogether.
AskBj rnHansenandRobertSpiermanagetheemail,revision
control,andbug-trackingsystems,aswellasthewebpagesfor
Perl6,Parrot,andPonie().Withoutthese
systems,theprojectwouldgrindtoascreechinghalt.
AllisonRandalistheprojectmanager.Asistypicalofopen
sourcedevelopmentprojects,managingthePerl6projectis
quitedifferentfrommanagingacommercialprojectofthesame
sizeandcomplexity.Therearenoschedules,nodeadlines,no
hiringandfiring,andnosalaries,bonuses,orstockoptions.
Therearenoemployeesorbosses;thereisverylittlehierarchy
whatsoever.Managementinthiscontextisn'taboutgiving
orders,it'saboutmakingsureeveryonehaswhattheyneedto