The Polyglot Future(程序员风向指南)

很早之前就订阅了Java Magazine,可以由于网络的原因迟迟没有收到,这周Oracle终于发来了最新一期的JavaMagazine,对于喜欢Java的人来说,是一个很好风向资料去参考和阅读。今天阅读了第一篇也是开篇的文章,内容明确,标题也挺有趣的,The Polyglot Future,通晓数种语言人的未来,阅读了一遍回味了一会,觉得这是给程序员们未来指了一个方向,所以我就翻译了一下,仅供参考。

以下是译文,最后会附上原文。

对于当今,几乎所有的商业编程开发都依赖于一种以上的编程语言,这已经不是什么秘密了。Java仍然从UI开始一直延伸到后端(back-end)的工作,它的角色也频繁的被其它的语言所辅助来完成一些功能的编写。有时这些部分可能使用脚本来编写,或者JVM语言来编写。在其它时候,一个更加通用的方案呈现了出来:一个Java的核心被一个UI利用JavaScript所完成。这种多语言(multilanguage)的现象,我们把它称作为polyglot programming(通晓数种语言的编程方式),这种方式暗示了要使用两种语言以上。但是如果这里只有一种语言可以选的话,那么毫无疑问,就是JavaScript了。

在很多方面,JavaScript一直是Java的好伙伴,从名字来看,Netscape选择了这个名字去切断Java的名气,因此对于非技术工作者来说产生了无尽了迷惑(最开始我也是)。之后,两者都是可以在Web Apps中来应用的。当然之后JavaScript经由Nashorn(从JDK8开始,Nashorn作为Js引擎取代了Rhino)作为一个Java的脚本语言。除此之外,google的WebToolkit工具,将Java转译成JavaScript,两个语言有了更深远的连接。

JavaScript同样渗入到了后端的计算工作,这个趋势就是Node鉴证的。一个JavaScript的框架会创建一个似服务端的环境,通过一个事件驱动的、非I/O阻塞的模型来为商业级的逻辑提供一个轻量级且高效率的环境。它的出现就像是十几年前Ruby在Rails上一样,一个轻巧的解决方案去解决小规模的项目一样。Node正在那些
环节上来扩张它的表现,这是由于它在那些广泛被使用的语言上得到的信赖。

原文

The Polyglot Future

It’s no secret that almost all commercial programs
today depend on more than one language.
While Java still stretches from the UI all the way
to the back-end work (a true end-to-end proposition),
its role is frequently complemented by functionality
written in other languages. Sometimes,
those parts are written using scripts or JVM languages.
At other times, a more common scenario
unfolds: a Java core surrounded by a UI written
in JavaScript. The multilanguage phenomenon—
referred to as polyglot programming—often implies
the use of more than two languages. But if there
is just one other language, that language is overwhelmingly
JavaScript.
In many ways, JavaScript has been an everemerging
partner to Java: starting with its name,
which Netscape chose to key off of Java’s popularity,
thereby causing endless confusion for
nontechnical audiences; then the use of both
languages in web apps, followed by their joint
use in mobile; and of course, then the use of
JavaScript as a scripting language for Java, via
Nashorn. In addition, tools such as the Google
Web Toolkit, which transpiles Java into JavaScript,
have furthered the connection between the
two languages.
JavaScript is also seeping into back-end computing.
This trend is most evident with Node (the
former node.js), a JavaScript framework that creates
a server-like environment for business logic
by providing “an event-driven, non-blocking I/O
model that makes it lightweight and efficient.”
Its emergence is like Ruby on Rails a decade ago: a
convenient solution to small-scale projects. Node
is likely to expand its presence in that sector due
to its reliance on a widely used language.

IT文库 » The Polyglot Future(程序员风向指南)
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址