谁是下个JVM王者语言?

                                                          The next big JVM language?

There’s an interesting thread of comments related to a blog post by Stephen Colebourne, who is giving a talk at this year’s JavaOne entitled “Next Big JVM language.” In particular, he and others note that the Fantom language could be the answer (I find this interesting as Fantom really wasn’t even on my radar. Until now.). Moreover, many of the threads claim Scala to be the next big language. It seems people still prefer static typing over dynamic-ness. Either way, I got the distinct impression, based upon those individuals that left comments, which, by no means reflects the community at large, that Groovy isn’t it.

Principally, the arguments against Groovy can be summarized as its lack of performance (compared to Scala, for instance). Not to be outdone, a few folks brought up Groovy++ (which attempts to add a bit of static-ness to Groovy ostensibly to increase performance). Nevertheless, the comments are quite interesting to read if for anything that Fantom is gaining mind share perhaps at the cost of other more mainstream alternatives like Groovy.

 

    这几年,关于谁是下一个JVM上的王者语言之争已经不是新鲜事情了。看了上面的文章,您是不是又所感慨呢?

 

笔者对部分上述语言接触过,下面发表一下意见:

 

Groovy:在这些上述语言中,我认为它是最接近于Java的语言,并且提供了闭包和动态类型等特性。学习曲线不陡峭,并且学习资源很多。可惜性能让人失望,因此,一直不被笔者考虑作为实现语言。当年的GoG就是模仿RoR来实现快速Web开发,方便地解析XML文件,集成Spring和ORM,这些让SSHer欣喜不易。本人虽然没有深入研究,不过规约大于配置的开发模式,着实让我眼前一亮。不过,动态语言Groovy并没有让我看到它的光明的未来。说到Groovy的未来,当然还看SpringSource发展路线。也许正如上文所说,Groovy++才是正确的方向。

 

Scala:这门函数型语言能够让Groovy发明者后悔,能够让twitter放弃Ruby(至少部分放弃),转而拥抱它。这些足以证明Scala是一门优秀语言,静态类型安全,提供闭包功能,简化并发编程,弥补Java的不足。不过它的语法确实比较晦涩,我想这就是它最大的伤痛。Scala前途还是比较光明的。

 

Fantom:实际上,笔者还没有接触过,只是看了下:http://fantom.org/doc/docIntro/WhyFantom.html 。它给我第一个感觉是,像雾像雨又像风(C++、Java和其他语言的混合体)。先不说它是否简单,不过它还是有特斯色的。当年,Java号称跨平台的语言,虽然目前.NET可以跨平台(如果您的是HelloWorld工程的话,不必担心风险)。可是Fantom确实跨语言加跨平台的,这个是很强大啦。目前,Java和.NET的跨语言不过是建立在JVM和CLR平台上。Java和.NET两大平台通讯还是需要靠第三方协议(比如WebServices)。Fantom其他的方面没有什么特色,并且学习资源太少。

 

Clojure:第一次知晓这门语言,是通过看庄周梦蝶 的Clojure的blog。本人正在学习中,这门语言让我想起了“伊波兰式”(操作符号在操作数之前),并且执行语句皆在"()"里面,真如其名-封闭(其实没有这个英文单词,只有closure)。尽管这门函数语言,语法上非常不贴近于Java,但是简洁的代码足以替代臃肿的Java代码,即使和Scala比较,也不是同一个级别的。不过和Scala一样,提供优雅的函式和并发编程,不过纠结的语法确实不适合传统C语言系的开发人员。不过我还是比较看好它,试想一旦掌握后,那是多么“暴力”的语言。

 

JavaScript:从感情和熟悉程度上,笔者偏好JS。众所周知,JS作为浏览器内建语言,提供了灵活的前端页面控制。语法上,从普通的函数编程发展到prototype和闭包,并且通俗易懂;功能上,从DOM操作,到Ajax,再到目前的WebSocket;实现上,从客户端程序到服务端程序。目前的Node.js(在V8平台)可以实现服务端I/O操作,那么,实现Web服务端不在话下。在Web2.0时代,熟悉JS的人要比熟悉Java人还要多。同时,Java 6.0提供了JavaScript解释引擎,.NET就更不用说了。综上分析,下一个JVM王者语言很有可能就是JavaScipt。

 

Java:这么多年来,Java是最成功的语言之一。无论哪门语言都有缺点,然而越是出名,越是招骂。Java 7的闭包、模块化和GC优化等功能能不能成功地拯救Java,就看JVM产商的啦。我相信,大家都期待Java能过王者回归。

 

似乎上述语言都有希望称为JVM的王者语言。从JVM实现来看,JVM还是非常强大的。

 

下文推崇Groovy和JRuby,以供参考:

 

                                                                                  Top five scripting languages on the JVM
   Groovy and JRuby lead a strong field, with Scala, Fantom, and Jython following behind

 

   Anyone who has followed software development tools during the last decade knows that the term "Java" refers to a pair of technologies: the Java programming language and the Java Virtual Machine (JVM). The Java language is compiled into bytecodes that run on the JVM. Through this design, Java delivers its vaunted portability.

The language and the JVM, however, have been increasingly moving in opposite directions. The language has grown more complex, while the JVM has become one of the fastest and most efficient execution platforms available. On many benchmarks, Java equals the performance of binary code generated by compiled languages such as C and C++. The increasing complexity of the language and the remarkable performance, portability, and scalability of the JVM have created an opening for a new generation of programming languages. These languages lack Java's syntax overload (often referred to disparagingly as its "ceremony") -- that is, the amount of excess code that needs to be cranked out before the code that does the actual work can be written -- but take advantage of the JVM.

......

 

 

PS:笔者学识和技术有限,不足的地方请指正。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值