本科毕业设计外文文献及译文文献、资料题目:EvolvingJavaWithoutChangingtheLanguage文献、资料来源:文献、资料发表(出版)日期:院(部):专业:班级:姓名:学号:指导教师:翻译日期:山东建筑大学毕业设计外文文献及译文--1外文文献:EvolvingJavaWithoutChangingtheLanguageInTheFeelofJavaJamesGoslingstatedthat:Javaisabluecollarlanguage.It'snotPhDthesismaterialbutalanguageforajob.JavafeelsveryfamiliartomanydifferentprogrammersbecauseIhadaverystrongtendencytopreferthingsthathadbeenusedalotoverthingsthatjustsoundedlikeagoodidea.TheextraordinarysuccessofJavaoffersweighttothenotionthatthiswasasensibleapproach,andifitremainsanimportantgoalforJavatoday,thenitmakessensethatthelanguageshouldcontinuetoevolverelativelyslowly.Inadditiontothis,thefactthatJavaisamature,widelyusedlanguagecausesitsevolutiontobefraughtwithdifficulty.Foronething,eachfeatureaddedtothelanguagecanchangethewayitfeelsinsubtleandoftenunpredictableways,riskingalienatingdeveloperswhohavealreadyadopteditastheirlanguageofchoice.Foranother,afeaturethatmakesperfectsenseonitsownmayinteractwithotherfeaturesofthelanguageinawkwardorunexpectedways.Worse,oncealanguagefeaturehasbeenaddeditisallbutimpossibletoremoveevenifitturnsouttobedetrimentaltothelanguageasawhole.Tojustifyaddinganewfeature,alanguagedesignermustbehighlyconfidentthatitwillbeoflongtermbenefittothelanguageratherthanashorttermorfashionablesolutiontoaproblemthatrapidlybecomesredundant.Tomitigatetheriskalanguagedesignerwilltypicallyexperimentbycreatingaseparatelanguageorbranch,suchasthePizzalanguageusedtoexperimentwithJava'sgenerics,priortotheirimplementation.Theproblemwiththisapproachisthattheaudienceforsuchexperimentsisbothsmallandself-selecting;obviouslytheywillallbeinterestedinlanguagefeatures,andmanymaybeacademicsorresearchers.Anideawhichplayswelltosuchanaudiencemaystillplaybadlywhenitisincorporatedintothemainlanguageandgeneralprogrammersstarttoworkwithit.Togetasenseofthis,considertheclosuresdebatethatbecamesoheatedforJava7.Implementationsforthemainproposals(andsomeothers)havebeenavailableforsometimebutnoconsensushasemerged.InconsequenceSundecidedthatJDK7willnotgetfullclosuressupport.ThecoreargumentcamedowntowhetherJavahadbecomeascomplexasitcouldaffordtobewhengenerics(andinparticularthewildcardsyntax)wereaddedtoJava5;and山东建筑大学毕业设计外文文献及译文--2whethertheadditionoffullsupportforclosureswasjustifiedwhenJavaalreadyhasamorelimitedformthroughanonymousinnerclasses.Twoimportantusecasesforaddingfullclosuressupportweretosimplifyworkingwiththefork/joinAPIthatisbeingaddedtoJDK7toimprovemulti-coreprogramming,andtohelpwithresourceclean-up.JoshBloch'sARMblockproposal,whichisnowexpectedtobeinJDK7viaProjectCoin,offersanalternativesolutiontothelatterproblem.Dr.CliffClick'sresearchonascalable,non-blockingprogrammingstyleforJavaoffersanalternativeapproachtofork/jointhatmaybemoreappropriateasthenumberofprocessorcoresincreases.Ifthisweretohappen,thentheusesforclosuresinJavamayarguablybetoolimitedtojustifytheirinclusion.Itremainsimportantthoughthataprogramminglanguagecontinuestodevelopatsomelevel.ThisarticlethereforeexaminesthreealternativetechniquesforaddingnewlanguagefeaturestoJavathatdon'trequirechangestothelanguageitself-usingacustomDomainSpecificLanguage,exploitingtheJava6annotationprocessortoaddoptionallanguagefeaturesviaalibrary,andmovingthesyntacticsugarfromthelanguagetotheIDE.Eachoffersthepotentialtoallowawideaudienceofmainstreamdeveloperstoexperimentwiththenewfeaturesoverthemediumterminanon-invasivemanner,andthebestideascanthenfilterdownforinclusioninthecorelanguage.CustomDSLsThemostwidelydiscussedofthethreeistheDomain-SpecificLanguageorDSL.Thereissomedisagreementonexactlywhatthetermmeans,butforthepurposesofthisdiscussionwe'llrefertoitsimplyasalanguagethathasbeencreatedwithanarrowfocustosolveaparticularproblem,ratherthanasageneralpurposelanguagedesignedtosolveeverycomputingproblem.AssuchwewouldexpectaDSLtobenon-Turingcompleteandforthemostpartthisisthecase.Thereareedgecasesofcourse.Postscript,forexample,isaTuringcompletelanguagebutalsoqualifiesasaDSLusingourdefinition.Astheaboveexamplealsoillustrates,theideaofaDSLisnotnew.OtherfamiliarDSLsincludeRegularExpressions,XSLT,Ant,andJSP,allofwhichrequiresomesortofcustomparsertoprocessthem.MartinFowleralsosuggeststhatfluentinterfaces/APIscanbeconsideredasecondtypeofDSL,whichhereferstoasaninternalDSL.HisdefinitionisthataninternalDSLisdevelopeddirectlywithinthehostlanguage.Thiswasacommonpracticeamongstboth山东建筑大学毕业设计外文文献及译文--3LispandSmalltalkprogrammers,andmorerecentlytheRubycommunityhasbeenpopularisingthetechnique.Whilstmanywell-knownDSLsarecommerciallydevelopedandmaintained,someenterprisedevelopmentteamshaveusedthetechniquetocreatealanguagethatallowsthemtorapidlyexploreaspectsoftheirproblemdomain.Itisn'thoweverascommonasitmightbe,perhapsbecauseDSLshaveafairlyintimidatingbarriertoentry.Theteamhastodesignthelanguage,buildtheparserandpossiblyothertoolstosupporttheprogrammingteam,andtraineachnewdeveloperthatjoinstheteamonhowtheDSLworks.HeretheemergenceoftoolstospecificallysupportDSLdevelopmentcouldsignificantlychang