ibmcom Abstract A duality can be thought of as a pair of concepts and a mapping between their terminology such that substituting the conceptspeci64257c terminology turns a statement about one concept into a statement about the other For example in 19 ID: 80375
Download Pdf The PPT/PDF document "Dualities in Programming Languages Marti..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
3.IncrementalComputation=Demand-DrivenComputationWearenotawareofpriorworkthatpointsoutthedualityofincrementalcomputation=demand-drivencomputation.Thoughbothconceptsareusefulinmanydomains,wecameacrosstheminthedomainofpointeranalysis.Incrementalpointeranalysiscomputesinitialpoints-tosetsfrominitially-knownfacts.Whennewfactsbecomeavailable(forinstance,duetodynamicclassloading),itincrementallyupdatesthepoints-tosets[5].Demand-drivenpointeranalysiscomputesinitialpoints-tosetsfromaninitialquery.Whennewqueriesareissued(forinstance,duetojust-in-timecompilation),itupdatesthepoints-tosetsinademand-drivenway[4]. Incrementalcomputationevaluatesanexpressiononlywhenanewinputbecomesavailabletoit.Demand-drivencomputationevaluatesanexpres-siononlywhenanewoutputisrequestedfromit.Recursively,whenincrementalcomputationpushesoutputfromasub-expressiontoanenclosingexpression,thattriggersevaluationoftheenclosingexpression.Recursively,whendemand-drivencomputationpullsinputtoanenclosingexpressionfromasub-expression,thattriggersevaluationofthesub-expression.Intheabsenceofside-effects,incrementalcomputationdiffersfromcompletefrom-scratchre-computationonlybydoinglessworkatatime.Intheabsenceofside-effects,demand-drivencom-putationdiffersfromcompletefrom-scratchpre-computationonlybydoinglessworkaheadoftime.Incrementalcomputationcanbeimplementedbymemo-tablesthatrememberoldinputswherethosedidnotchange.Demand-drivencomputationcanbeimplementedbymemo-tablesthatrememberoldoutputswherethosedidnotchange.Makinganyalgorithmincrementalordemand-drivencanbeachallengingresearchproblem.Ofcourse,researchitselfoftentstheseconcepts:researchisoftenincremental(asreviewersfrequentlycontest)ordemand-driven(asdeadlinesmakepainfullyclear).4.OtherDualitiesinProgrammingLanguagesWhenwritingapaper,twoexamplesqualifyasgeneralandthreeexamplesqualifyasuniversal.Here,wegobeyonduniversalbygivingmorethanthreeexamplesofdualitiesinprogramminglanguages.Dualitiesabound,justwaitingtobedescribed.Staticanalysisndsanover-approximationofwhatitislookingfor.Itsuffersfromfalsepositives,becauseitcannottellwhetherthecodeitislookingatwilleveractuallyexecute.Dynamicanalysisndsanunder-approximationofwhatitislookingfor.Itsuffersfromfalsenegatives,becauseitcannotlookatcodethatdoesnotactuallyexecuteinaparticularrun.Reachability-basedgarbagecollectionstartsatroots(denitely-liveobjects),andtraversesthetransitiveclosure(moreliveobjects),incrementingamark-bit[2].Reference-countinggarbagecollectionstartsatanti-roots(denitely-deadobjects),andtraversesthetransitiveclosure(morepossibly-deadobjects),decrementingareference-count[2].Changepropagationisatechniqueforincrementalcomputationthatre-runspartialcomputationsaffectedbyaninputchange[1].Memoizationisatechniqueforincrementalcomputationthatre-usespartialresultsunaffectedbyaninputchange[1].Alanguageruntimesystemvirtualizesoverphysicalhardware,maintainingspaceresourceswithamemorymanager,whileprovidingprotectionwithtypes.Anoperatingsystemvirtualizesoverphysicalhardware,maintainingspaceresourceswithapagingsubsystem,whileprovidingprotectionwithvirtualmemory.Amethod-basedJITcompilesonemethodatatime.Toprovidemorecontextforoptimizationandreducecalloverheads,itofteninlinesothermethods.Atrace-basedJITcompilesonetraceatatime.Toprovidemorecontextforoptimizationandreducestitchingoverheads,itoftencollatestraces.Thedetaileddevelopmentofthesedualities,andthediscoveryofmoredualities,areleftasanexercisetothereader.5.Problem=SolutionResearchoftenstartsfromarelevantproblem,andthechallengeisdevelopingadeepsolution.Researchoftenstartsfromadeepsolution,andthechallengeisndingarelevantproblem.Inotherwords,ittreatsthesolutionasameta-problem.Inotherwords,itseekstheproblemasameta-solution.Onewaytodothisistolookatadualproblemthatalreadyhasadeepsolution,thenadaptthatsolutiontotheproblemathand.Onewaytodothisistolookatadualsolutionthatalreadyhasarelevantproblem,thenadaptthatproblemtothesolutionathand.Ifthedualdomainsaretoosimilar,thenitmaybetooobvioushowasolutionfromoneappliesintheother.Ifthedualdomainsaretoosimilar,thenitmaybetooobvioushowaproblemfromoneappearsintheother.Therefore,adualitythatisnotquiteperfectisactuallydesirablefromaresearchperspective,becauseworkingaroundtheimperfectionslendsnoveltytotheadaptedsolution.Therefore,adualitythatisnotquiteperfectisactuallydesirablefromaresearchperspective,becauseworkingaroundtheimper-fectionslendsnoveltytotheadaptedproblem.References[1]UmutA.Acar,GuyE.Blelloch,MatthiasBlume,RobertHarper,andKanatTangwongsan.Anexperimentalanalysisofself-adjustingcomputation.TransactionsonProgrammingLanguagesandSystems(TOPLAS),2009.[2]DavidBacon,PerryCheng,andV.T.Rajan.Auniedtheoryofgarbagecollection.InObject-OrientedProgramming,Systems,Lan-guages,andApplications(OOPSLA),2004.[3]DanGrossman.Thetransactionalmemory/garbagecollectionanal-ogy.InEssayTrackofObject-OrientedProgramming,Systems,Lan-guages,andApplications(OOPSLA),2007.[4]NevinHeintzeandOlivierTardieu.Demand-drivenpointeranaly-sis.InProgrammingLanguageDesignandImplementation(PLDI),2001.[5]MartinHirzel,DanielvonDincklage,AmerDiwan,andMichaelHind.Fastonlinepointeranalysis.TransactionsonProgrammingLanguagesandSystems(TOPLAS),2007.[6]HughC.LauerandRogerM.Needham.Onthedualityofoperatingsystemstructures.OperatingSystemsReview,1979.[7]JenniferB.Sartor,MartinHirzel,andKathrynS.McKinley.Nobitleftbehind:Thelimitsofheapdatacompression.InInternationalSymposiumonMemoryManagement(ISMM),2008.[8]BenL.TitzerandJensPalsberg.Verticalobjectlayoutandcompres-sionforxedheaps.InCompilers,Architectures,andSynthesisforEmbeddedSystems(CASES),2007.2