计算机专业不改变语言的前提下推进Java演进毕业论文外文文献翻译及原文Word下载.docx

上传人:b****5 文档编号:16872140 上传时间:2022-11-26 格式:DOCX 页数:9 大小:31.38KB
下载 相关 举报
计算机专业不改变语言的前提下推进Java演进毕业论文外文文献翻译及原文Word下载.docx_第1页
第1页 / 共9页
计算机专业不改变语言的前提下推进Java演进毕业论文外文文献翻译及原文Word下载.docx_第2页
第2页 / 共9页
计算机专业不改变语言的前提下推进Java演进毕业论文外文文献翻译及原文Word下载.docx_第3页
第3页 / 共9页
计算机专业不改变语言的前提下推进Java演进毕业论文外文文献翻译及原文Word下载.docx_第4页
第4页 / 共9页
计算机专业不改变语言的前提下推进Java演进毕业论文外文文献翻译及原文Word下载.docx_第5页
第5页 / 共9页
点击查看更多>>
下载资源
资源描述

计算机专业不改变语言的前提下推进Java演进毕业论文外文文献翻译及原文Word下载.docx

《计算机专业不改变语言的前提下推进Java演进毕业论文外文文献翻译及原文Word下载.docx》由会员分享,可在线阅读,更多相关《计算机专业不改变语言的前提下推进Java演进毕业论文外文文献翻译及原文Word下载.docx(9页珍藏版)》请在冰豆网上搜索。

计算机专业不改变语言的前提下推进Java演进毕业论文外文文献翻译及原文Word下载.docx

文献、资料英文题目:

EvolvingJavaWithoutChanging

theLanguage

文献、资料来源:

文献、资料发表(出版)日期:

院(部):

专业:

班级:

姓名:

学号:

指导教师:

翻译日期:

2017.02.14

本科毕业设计

外文文献及译文

文献、资料题目:

外文文献:

 

EvolvingJavaWithoutChangingtheLanguage

In"

TheFeelofJava"

JamesGoslingstatedthat:

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;

andwhethertheadditionoffullsupportforclosureswasjustifiedwhenJavaalreadyhasamorelimitedformthroughanonymousinnerclasses.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.

CustomDSLs

ThemostwidelydiscussedofthethreeistheDomain-SpecificLanguageorDSL.Thereissomedisagreementonexactlywhatthetermmeans,butforthepurposesofthisdiscussionwe'

llrefertoitsimplyasalanguagethathasbeencreatedwithanarrowfocustosolveaparticularproblem,ratherthanasageneralpurposelanguagedesignedtosolveeverycomputingproblem.AssuchwewouldexpectaDSLtobenon-Turingcompleteandforthemostpartthisisthecase.Thereareedgecasesofcourse.Postscript,forexample,isaTuringcompletelanguagebutalsoqualifiesasaDSLusingourdefinition.

Astheaboveexamplealsoillustrates,theideaofaDSLisnotnew.OtherfamiliarDSLsincludeRegularExpressions,XSLT,Ant,andJSP,allofwhichrequiresomesortofcustomparsertoprocessthem.MartinFowleralsosuggeststhatfluentinterfaces/APIscanbeconsideredasecondtypeofDSL,whichhereferstoasaninternalDSL.HisdefinitionisthataninternalDSLisdevelopeddirectlywithinthehostlanguage.ThiswasacommonpracticeamongstbothLispandSmalltalkprogrammers,andmorerecentlytheRubycommunityhasbeenpopularisingthetechnique.

Whilstmanywell-knownDSLsarecommerciallydevelopedandmaintained,someenterprisedevelopmentteamshaveusedthetechniquetocreatealanguagethatallowsthemtorapidlyexploreaspectsoftheirproblemdomain.Itisn'

thoweverascommonasitmightbe,perhapsbecauseDSLshaveafairlyintimidatingbarriertoentry.Theteamhastodesignthelanguage,buildtheparserandpossiblyothertoolstosupporttheprogrammingteam,andtraineachnewdeveloperthatjoinstheteamonhowtheDSLworks.HeretheemergenceoftoolstospecificallysupportDSLdevelopmentcouldsignificantlychangethelandscape.IntentionalSoftware'

sIntentionalDomainWorkbench,whichhasbeenindevelopmentlongerthanJavahasbeenaround,isthefirstsignificantimplementationofsuchatool.TheprojectstartedlifeatMicrosoftResearch,andDr.CharlesSimonyi'

s1995paper"

TheDeathofComputerLanguages,theBirthofIntentionalProgramming"

describeshisvision.In2002SimonyifoundedIntentionalSoftwaretocontinueworkingonhisideasandahugelyimpressivevideodemoofthesystemisavailable.Theproductitselfisat1.0status,butaccessisrestrictedtoverylimitedpartners.

Othersoftwarehousesarealsoexploringtheconcepts,amongstthemJetBrains,wellrespectedfortheirIntelliJIDEAJavaIDE,whohaverecentlyreleasedthe1.0versionoftheirMetaProgrammingSystem(MPS).MPSdoesn'

tuseaparser,insteadworkingwiththeAbstractSyntaxTree(AST)directly.Itprovidesatext-likeprojectionaleditorwhichallowstheprogrammertomanipulatetheAST,andisusedtowritelanguagesandprograms.Foreachnodeinthetreeatextualprojectioniscreated-astheprogrammerworkswiththeprojection,thechangeisreflectedinthenode.Thisapproachallowsyoutoextendandembedlanguagesinanycombination(oftenreferredtoaslanguagecomposing)promotinglanguagere-use.JetBrainsareusingtheproductinternallyandhaverecentlyreleasedYouTrack,abugtrackingproductdevelopedusingthesystem.

TheJava6AnnotationProcessor

WhilstDSLsarelesscommoninmoremainstreamlanguagessuchasJavathantheyareinRuby,SmalltalkandLisp,recentdevelopmentsintheJavalanguage,inparticulartheannotationprocessorwhichwasaddedinJava6,offernewpossibilitiesfordeveloperslookingtousetheminJava.TheJPA2.0criteriaAPIthatwillshipaspartofJavaEE6,itselfaDSL,offersanexample.Heretheannotationprocessorbuildsupametamodeltypeforeachpersistentclassintheapplication.WhilstitwouldbeperfectlypossibleforthedevelopertohandcraftthemetamodelinJava,itwouldbebothtediousanderrorprone.Theuseoftheannotationprocessoreliminatesthatpainand,sincetheannotationprocessorisbuiltintoJava6,theapproachrequiresnospecificIDEsupport–anIDEdelegatestotheannotationprocessortriggeredbythecompiler,andthemetadatamodelisgeneratedonthefly.

Usingtheannotationprocessoritisalsopossibleforalibrarytoaddanewlanguagefeature.BruceChapman'

sprototype"

noclosures"

proposal,forexample,usesthetechniquetoprovideamechanismforcastingamethodtoaSingleAbstractMethod(SAM)typewhichcompilesontopofJava6.DuringourconversationChapmanpointedoutthattheSAMtypealsosupportsfreevariables,akeyaspectofaclosure:

ThemethodbodycandeclareadditionalparametersbeyondthoserequiredfortheSingleAbstractMethodusingthe@As.Additionalannotation.TheseparameterscanhavevaluesboundtothematthepointwhereyouobtainaninstanceoftheSAMtype,andarethenpassedtothemethodeachtimeitisinvoked.

ChapmanalsosetuptheRaptprojecttoexploreotherusesofthetechnique,andhasaddedimplementationsfortwolanguagechanges-MultilineStringsandXMLliterals-thatwereconsideredforJDK7butwon'

tnowmakeitintothefinalrelease.Javacouldevengetaformofclosuressupportusingthisapproach.Whenaskedaboutthis,Chapmansaid:

WearejustfinishingaSwingprojectwhichweuseditfor.Wehavefoundacoupleofminorbugsaroundgenerictypes,onerecentlydiscoveredremainstobefixedbutotherthanthatitseemsquitenicetouse,andnobodyhasbeenwantingtorushbacktouseconventionalanonymousinnerclasses.

ProjectLombok,anotherprojectexploringthetheannotationprocessor,pushesthetechniquestillfurther.IneffectL

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 外语学习 > 日语学习

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1