Haskell vs. Ada vs. C++ vs. Awk vs. ... - An Exper

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

Haskellvs.Adavs.C++vs.Awkvs....AnExperimentinSoftwarePrototypingProductivityPaulHudakMarkP.JonesYaleUniversityDepartmentofComputerScienceNewHaven,CT06518hudak-paul,jones-mark@cs.yale.eduJuly4,1994AbstractWedescribetheresultsofanexperimentinwhichseveralconventionalprogramminglan-guages,togetherwiththefunctionallanguageHaskell,wereusedtoprototypeaNavalSurfaceWarfareCenter(NSWC)requirementforaGeometricRegionServer.TheresultingprogramsanddevelopmentmetricswerereviewedbyacommitteechosenbytheNavy.TheresultsindicatethattheHaskellprototypetooksignificantlylesstimetodevelopandwasconsiderablymoreconciseandeasiertounderstandthanthecorrespondingprototypeswritteninseveraldifferentimperativelanguages,includingAdaandC++.ThisworkwassupportedbytheAdvancedResearchProjectAgencyandtheOfficeofNavalResearchunderArpaOrder8888,ContractN00014-92-C-0153.01IntroductionThefunctionalprogrammingcommunityhasworkedlongandhardtomakefunctionallanguagesgoodenoughforuseinindustrialandcommercialapplications;thecommunitydreamsofthedaywhenHaskellorMLwillreplaceCinrealapplications!Althoughwearenowreachingapointwheresomeofthesedreamsarebecomingreality,thereisanotherfrontuponwhichwecanhopeforsuccess:theuseoffunctionallanguagesinprototyping.Thisideahasofcoursebeenrecognizedforalongtime(seeforexample[Hen86]),butrecenttrendsinthesoftwareindustryhaveincreasedtheimportanceofthisidea:astronginterestinthedisciplineduseofprototypinghasarisenincontemporarytheoriesofsoftwareengineering.Perhapsironically,itisthelargestofsoftwaredevelopers,onthelargestofprojects,thathavemostrecognizedthevalueofprototyping,andarebeginningtointegrateitintotheirsoftwaredevelopmentprocessasalegitimate,wellthought-outphaseinthesoftwarelife-cycle.Thecriticalfactthathighlightstheutilityofprototypingisaverysimpleone:onmostsoftwareprojects,theoverallproblemisnotwellunderstood,orperhapsworse,iswronglyunderstood.Theprimarygoalofprototypingissimplytounderstandbetterboththeproblemandthesolutionspace!Thishastheeffectofreducingrisk:studieshaveshownthatthecosttofixafaultearlyinthesoftwarelife-cycleisexponentiallylessthanthecosttofixitlater.Inthislight,thebenefitsofsoftwareprototypingcanbeseeninmanydifferentways.Effectiveprototypingpermitsrapidexplorationofseveraldifferentspaces,eachaffectingadifferentphaseofthesoftwarelife-cycle:1.Explorationoftheproblemspacehelpsustobetterunderstandtheproblemitself,thusfacilitatingtherequirementsacquisitionphase.2.Explorationofthesolutionspacehelpsustoexploretheviabilityofdifferentsolutions,thusfacilitatingthespecificationphase.3.Explorationofthedesignspacehelpsustoexperimentwithdifferentsoftwarestructures,thusfacilitatingthedesignphase.4.Explorationoftheresourcespaceenablesustoexperimentwithspecifictoolandresourcecommitments,thusfacilitatingtheimplementationphase.Theabovesequencereflectsourpotentiallypoorunderstandingoftheproblem,thesolutions,andtheavailabletoolsandresources;therearemanydimensionstofullyunderstandanddevelopalargesystem.Ifoneofthesedimensionsisinfactfullyunderstood,thatcomponentofprototypingcanbede-emphasizedoreliminated;butitisextremelyrarethatallofthedimensionsarefullyunderstoodforanysystemofreasonablemagnitudeandcomplexity.Althoughitseemsthattheemphasishereisontheuseofprototypingonlyatearlyphasesinsystemsdevelopment,thereareseveralwaysinwhichitcanpermeatethesoftwarelife-cycle:First,modernnotionsoflargesystemsdesignareiterativeinnature;eachoftheseiterationsmayinvolvesomedegreeofprototyping.Second,akeyproductofprototypingisadocumentthatdescribeswhathasbeenlearned;oftenthisdocumentistheprototypeitself,whichserves1asanexecutablespecificationoftheproblemandinfluencesnotjustimplementation,buttest,integration,anddocumentationaswell.Finally,theprototypeitselfmayberefinedforlateruseastheactualdeliveredcode;thisbringsusfullcircletotheuseoffunctionallanguagesinreplacingC.Therefinementprocessmustensurethatallaspectsofperformanceareachieved,andmayinvolvetheuseofinter-operabilitymechanismstorewritecritical“innerloops”inalower-levellanguage.Wefeelthatthemodernnotionofsoftwareprototypingoutlinedaboveisagrandopportunityforthefunctionalprogrammingcommunitytohaveamajorimpactonthewaysoftwareisdevelopedintheindustrial,commercial,andmilitarysectors.Inthispaperwedescribeanexperimentthatlendsweighttothisargument.2TheNSWCExperimentInrecognitionoftheimportanceofprototypinginsoftwaredevelopment,theUnitedStatesAdvancedResearchProjectsAgency(ARPA)launchedaprogramin1989todevelopthelanguages,tools,andinfrastructurenecessarytoenhancetheprototypingprocess.Theresulting“ProtoTech”programyieldedseveralusefultechnologies,mostnotablyaseriesofprogramminglanguagestargetedspecificallyforprototypingapplications.YaleUniversity’sinvolvementemphasizedtheuseofthethen-newfunctionallanguageHaskell[HPJWe92].Inthefallof1993,inanefforttomeasurethesuccessoftheProtoTechprogram,ARPAconductedanexperimentincollaborationwiththeOfficeofNavalResearch(ONR)andtheNavalSurfaceWarfareCenter(NSWC).Theexperimentwasconductedasfollows:1.Asimplifiedversionofreal-worldproblemwaschosenbyNSWC.Thisproblem,ageomet-ricregi

1 / 17
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功