ITeye博客

谁是下个JVM王者语言?

mercyblitz · 2010-08-16 21:01 · Programming Languages · 编程语言 · Markdown

http://thediscoblog.com/2010/08/11/the-next-big-jvm-language/ 写道

                                                          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,以供参考:

 

http://www.infoworld.com/d/developer-world/top-five-scripting-languages-the-jvm-855?page=0,0写道

                                                                                  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:笔者学识和技术有限,不足的地方请指正。

评论(51)

  1. #51 楼 · braveone · 2011-01-30 10:19

    掉进java这个大缸里,要学一辈子的习,想着java还没完全掌握,还有什么javaee、spring、hibernate这些掌握虽然可以干活,但在java的世界这完全是刚起步,完全心颤,胆寒,但真为java世界的生机勃勃惊叹不已。

  2. #50 楼 · baby8117628 · 2010-08-24 13:33

    mysyche writes:

    任何的计算机语言的出现,都是为了满足和解决需要的,java能用几年的时间到现在的使用情况,已经是真正的王者。现在出现的一些动态语言(groovy),只能说:提高开发效率,语法更自然些,但不能说对习用应用的运行就有好处的。 一些小的应用如:网站 可以采用 。大型的应用 还只能是java。

    我未来3年内还是坚挺:java。别的动态语言,接近java 我再考虑学习,和使用。

    应该这样,不要盲目的追求某些新东西.

  3. #49 楼 · mercyblitz · 2010-08-24 13:32

    baby8117628 writes:

    [quote=mercyblitz][quote=lkj107] javascript跟jvm有关系? [/quote] JavaScript可以在JVM上运行,并且调用Java丰富的类库和JRuby一样。

    [/quote] 可以这样么???

    当然可以,你可以看看 JVM Script engine。

  4. #48 楼 · baby8117628 · 2010-08-24 13:32

    tuoxie007 writes:

    本人正在准备抛弃Java投向ROR的怀抱

    你是一个很冲动的人.

  5. #47 楼 · baby8117628 · 2010-08-24 13:31

    mercyblitz writes:

    [quote=lkj107] javascript跟jvm有关系? [/quote] JavaScript可以在JVM上运行,并且调用Java丰富的类库和JRuby一样。

    可以这样么???

  6. #46 楼 · robert · 2010-08-19 14:50

    shxiao writes:

    肯定是clojure,语言简洁而且表达能力太强悍了.

    两年前就开始关注,只可惜写过一点点小项目,被上司直接拒绝了..

    Clojure 的学习曲线就在第一个小时。 因为它太不同了,基于 S-Expression 和那么多基于语句的语言好像完全来自两个星球。

    但如果任何有真正经验的 Java 程序员用 5 个小时来走完 labrepl 这个基础教程,你一定会爱上它。你会感到惊奇,为什么这么少语法会达到这么高的表达能力?为什么基本不用面向对象也能有更高的质量?为什么消灭变量就消灭了 Bug?

    Clojure 能否成为下一个关键语言的未来在于所有程序员内心的开放程度。如果你能真的开放,你很难拒绝它。

  7. #45 楼 · mercyblitz · 2010-08-19 13:28

    shxiao writes:

    肯定是clojure,语言简洁而且表达能力太强悍了.

    两年前就开始关注,只可惜写过一点点小项目,被上司直接拒绝了..

    一般上司多少有点保守,并不是批判,而是现实主义。

    看看专家的意见,

    In fact, this is often a way to spot a noob. The believe they know it all, and will argue to death either online or offline. They will argue in absolutes, like "This is ALWAYS better than that", or "This is THE way to things" etc. Experts rarely do that. They know, that it all depends on situation, skills your developers have, tools chosen by your company, company policies, personal preferences etc. Inexperienced developers (and people in general) tend to believe the world is black and white. Experts know, it's full of gray scales, and even lots of additional colors and shades.

    来自: http://www.iteye.com/topic/740505

  8. #44 楼 · shxiao · 2010-08-19 13:24

    肯定是clojure,语言简洁而且表达能力太强悍了.

    两年前就开始关注,只可惜写过一点点小项目,被上司直接拒绝了..

  9. #43 楼 · sinoyster · 2010-08-19 11:26

    如果groovy++能并入 groovy,那么grails还是很强悍的

  10. #42 楼 · tuoxie007 · 2010-08-19 10:01

    本人正在准备抛弃Java投向ROR的怀抱

  11. #41 楼 · mercyblitz · 2010-08-18 15:19

    mysyche writes:

    任何的计算机语言的出现,都是为了满足和解决需要的,java能用几年的时间到现在的使用情况,已经是真正的王者。现在出现的一些动态语言(groovy),只能说:提高开发效率,语法更自然些,但不能说对习用应用的运行就有好处的。 一些小的应用如:网站 可以采用 。大型的应用 还只能是java。

    我未来3年内还是坚挺:java。别的动态语言,接近java 我再考虑学习,和使用。

    我倒是认为开发语言不应该拘泥于形式(语法),而是看使用场景和语义完整性。

  12. #40 楼 · mysyche · 2010-08-18 15:14

    任何的计算机语言的出现,都是为了满足和解决需要的,java能用几年的时间到现在的使用情况,已经是真正的王者。现在出现的一些动态语言(groovy),只能说:提高开发效率,语法更自然些,但不能说对习用应用的运行就有好处的。 一些小的应用如:网站 可以采用 。大型的应用 还只能是java。

    我未来3年内还是坚挺:java。别的动态语言,接近java 我再考虑学习,和使用。

  13. #39 楼 · mercyblitz · 2010-08-18 10:32

    Arden writes:

    [quote=mercyblitz][quote=tamsiuloong]js还能在jvm里面运行?是不是真的啊?意味着什么呢[/quote]

    完全可以,JDK 6 集成了在Mozillia的JS工程rhino [url]http://www.mozilla.org/rhino/[/url]。

    [/quote]

    看看ringojs http://github.com/ringo/ringojs

    貌似就是建立在Rhino上面的Stack,呵呵!

  14. #38 楼 · Arden · 2010-08-18 10:27

    mercyblitz writes:

    [quote=tamsiuloong]js还能在jvm里面运行?是不是真的啊?意味着什么呢[/quote]

    完全可以,JDK 6 集成了在Mozillia的JS工程rhino [url]http://www.mozilla.org/rhino/[/url]。

    看看ringojs http://github.com/ringo/ringojs

  15. #37 楼 · mercyblitz · 2010-08-18 09:48

    tamsiuloong writes:

    js还能在jvm里面运行?是不是真的啊?意味着什么呢

    完全可以,JDK 6 集成了在Mozillia的JS工程rhino http://www.mozilla.org/rhino/。

  16. #36 楼 · tamsiuloong · 2010-08-18 08:54

    js还能在jvm里面运行?是不是真的啊?意味着什么呢

  17. #35 楼 · lishali12345 · 2010-08-18 08:18

    对Scala有点兴趣,楼主的分析还是很给力啊

  18. #34 楼 · mercyblitz · 2010-08-17 23:26

    Arden writes:

    [quote=mercyblitz][quote=heoxsoft] Clojure is a dynamic programming language that targets the Java Virtual Machine. It is designed to be a general-propose language, combine the approachability and interactive development of a scripting language with an efficient and robust infrastructure of multithread programming. Clojure is a compliled language - it compiles directly to JVM bytecode. yet remains completely dynamic. Every feature supported by Clojure is supported at runtime. Clojure provides easy access to Java frameworks, with optional type hints and type inference. to ensure calls to Java can avoid reflection. Clojure is a dialect lisp, and shares with Lisp the code-as-data philosophy and a powerful of macro system. Clojure is predominatantly a functional programming language, and features a rich set of immutable, persistent data structures. When mutable state is needed, Clojure offers a software transactional memory system and reactive Agent system that ensure clean, correct, multithreaded design.

    Regards Limux [/quote]

    本人正在学习它,我感觉它确实很简洁![/quote]

    Clojure的语法结构也太不习惯了,比scala还难看~~

    简单是要付出代价的,难看更有技术含量噻!

  19. #33 楼 · Arden · 2010-08-17 23:08

    mercyblitz writes:

    [quote=heoxsoft] Clojure is a dynamic programming language that targets the Java Virtual Machine. It is designed to be a general-propose language, combine the approachability and interactive development of a scripting language with an efficient and robust infrastructure of multithread programming. Clojure is a compliled language - it compiles directly to JVM bytecode. yet remains completely dynamic. Every feature supported by Clojure is supported at runtime. Clojure provides easy access to Java frameworks, with optional type hints and type inference. to ensure calls to Java can avoid reflection. Clojure is a dialect lisp, and shares with Lisp the code-as-data philosophy and a powerful of macro system. Clojure is predominatantly a functional programming language, and features a rich set of immutable, persistent data structures. When mutable state is needed, Clojure offers a software transactional memory system and reactive Agent system that ensure clean, correct, multithreaded design.

    Regards Limux [/quote]

    本人正在学习它,我感觉它确实很简洁!

    Clojure的语法结构也太不习惯了,比scala还难看~~

  20. #32 楼 · mercyblitz · 2010-08-17 22:48

    heoxsoft writes:

    Clojure is a dynamic programming language that targets the Java Virtual Machine. It is designed to be a general-propose language, combine the approachability and interactive development of a scripting language with an efficient and robust infrastructure of multithread programming. Clojure is a compliled language - it compiles directly to JVM bytecode. yet remains completely dynamic. Every feature supported by Clojure is supported at runtime. Clojure provides easy access to Java frameworks, with optional type hints and type inference. to ensure calls to Java can avoid reflection. Clojure is a dialect lisp, and shares with Lisp the code-as-data philosophy and a powerful of macro system. Clojure is predominatantly a functional programming language, and features a rich set of immutable, persistent data structures. When mutable state is needed, Clojure offers a software transactional memory system and reactive Agent system that ensure clean, correct, multithreaded design.

    Regards Limux

    本人正在学习它,我感觉它确实很简洁!

评论功能维护中,当前仅展示历史评论。