`
Eastsun
  • 浏览: 308214 次
  • 性别: Icon_minigender_1
  • 来自: 天津
社区版块
存档分类
最新评论

Groovy, JRuby, Jython, Scala:谁是胜利者?

阅读更多
原文地址:Groovy, JRuby, Jython, Scala: Who Wins the Script Bowl?

  简介: 这是一场关于脚本语言的“擂台赛”(严格说,Scala应该不属于脚本语言), Guillaume LaForge代表Groovy,Charles Nutter代表JRuby,Frank Wierzbicki代表Jython以及Jorge Ortiz代表Scala。他们展开了三轮的竞赛,每次比赛他们都需要展示一个Demo,然后有三分钟的时间向观众解说这个Demo,而观众可以通过短信对比赛进行投票。
  这三轮比赛包括一个桌面应用,一个Web应用,以及一个自由发挥的项目用来展示各个脚步语言最擅长的东东。擂台赛的最后结果是:JRuby获得了第一,Groovy其次,然后是Scala与Jython。

A=Groovy, B=JRuby, C=Jython, D=Scala


引用
Wednesday's Script Bowl was indeed what the caption promised, a rapid-fire comparison of scripting languages. Four developers took on the challenge to convince the audience of their language of choice -- in only three minutes per round. Guillaume LaForge represented Groovy, Charles Nutter represented JRuby, Frank Wierzbicki represented Jython, and Jorge Ortiz represented Scala.

All four languages compile to Java bytecode, but what distinguishes them? The jury, made up of Roberto Chinnici, Carol McDonald, and Ola Bini, made the four contestants compete in three categories: Each developer had prepared three demos, a desktop application, a web application, and one free-form app that shows off what the particular scripting language does best. After each round, the host Rags Srinivas encouraged the attendees to vote by sending text messages.

The rich client app demos were first. The task was to implement a desktop client that allows you to log on to Twitter and view your friends' feeds and status, and search for text in their postings. The ability to post was not required, but some of the demo'ed clients could.

The Groovy implementation clearly followed the MVC pattern and the language features made it very easy to parse the XML input; the GUI made a good impression. The JRuby implementation was designed using the NetBeans GUI builder (Matisse) and the Profligacy library, and therefor looked like a native app on MacOS; the users of this JRuby app will also appreciate that the build script generated native executables for different operating systems. The Jython app could save time by reusing an already existing model for accessing Twitter APIs; still the app was an odd one out, since it had to be started from the Terminal, and despite having a GUI with buttons to select Twitterers, the output was printed to the Terminal (frankly it looked as if he didn't have time to complete the UI). The Scala developer got started quickly by extending a SimpleGuiApplication class for desktop apps; Scala also made it easy to parse XML input, and the jury pointed out the clean error handling.

Next came the web applications. The application should access a MySQL database containing a world factbook, allow the user to browse facts about countries, and sort entries by criteria (language, population, etc). Additionally it should display the selected cities on a map.

The Groovy developer of course relied on the Grails framework together with Hibernate to access the database. The web application contributed by the JRuby community relied on the Rails framework and hooked up the components using the NetBeans IDE. The Jython web application relied on the Django framework with good-looking results. All three web applications made good use of their respective web frameworks and came with nice user-friendly web interfaces. Only the Scala team failed to produce the required web application and lost votes accordingly; instead, they demo'ed two other web apps, a chat client and a task list that use Ajax to keep the view up-to-date.

A quick look at the votes shows that JRuby and Groovy are presently the most popular choices in the audience... Will Scala and Jython catch up in the last round, where each team gets a chance to show off what their language can do best?

The Groovy representative decides not to show off demo apps, but instead he convinces the audience by talking about the seamless Java integration that Groovy is famous for. But then the JRuby submissions wow the audience with their smooth visual beauty: The first demo is a Star Wars-like scrolling Twitter client; the second demo is a 'Face For Steven Hawkins', a flock of colored dots that vibrate and change colors in response to audio input. Yes, admittedly, not very useful, but... pretty! The Jython representative chose to demo the Terminal-based Python help system that will soon be integrated into Jython too. The Scala demo was an application that searches and counts words in RSS feeds; it showed very well how Scala handles concurrency in minithreads.

Before the results were made public, the audience had a chance to pose questions to the experts. Asked about the relation of JavaFX to the other languages demonstrated today, Charles Nutter explained that each language was justified by its unique approach, so he does not see JavaFX as competition, but a powerful contribution to the variety of scripting languages. Another attendee asked how exactly languages such as Scala integrate with Java? All scripts written in these four languages compile to Java bytecode (war or jar files) that run on the standard JVM. Regarding Scala, Jorge Ortiz remarked that calling Java libraries from Scala apps is however easier than calling Scala from Java apps.

Finally, Rags announces the winner: JRuby! Groovy comes second, then Scala, and Jython (Check the final results in Rags' Blog, A=Groovy, B=JRuby, C=Jython, D=Scala). Jython had produced good results, but may have lost a few points for the terminal hacking required to start the applications, since all other contestants used IDEs. Although it felt a bit rushed and it was sometimes hard to pick up the details, this format of comparison is very suitable to get an overview of the "contestants".

3
3
分享到:
评论
11 楼 lzycxy 2009-09-08  
scala绝对值得你去学习
10 楼 rovanz 2009-08-16  
scala is wonderful
9 楼 bneliao 2009-07-25  

我因为对c++泛型支持的不足,c++ 0把concept剔出标准而找一个可以替代的语言,

scala非常符合我的需求,他很自然,符合人的思维表达方式,而又有性能的保障;

我非常喜欢scala,不过有scala插件的eclipse的ide做的不好,似乎连语法高亮都没有支持,

如果ide上scala有一个提升就非常完美了
8 楼 guava 2009-07-22  
真正的项目里有用到这些语言吗?
7 楼 徐风子 2009-07-21  
groovy和java最亲近,学习曲线很小,可以一上手就用。
scala最有前途,之前不看好静态语言,但学了scala以后才知道静态语言原来还是大有作为的。 scala主要问题是语法太奇怪,学习曲线太大,但你习惯了以后就会喜欢上他了。
6 楼 Eastsun 2008-10-17  
Netbeans上的Scala插件很不错啊
5 楼 aninfeel 2008-10-16  
scala很不错啊,可惜编辑器支持太少了
4 楼 Arden 2008-06-15  
还是喜欢groovy,groovy调用java库非常方便。
3 楼 gm8pleasure 2008-05-20  
Scala太诡异了
2 楼 jolestar 2008-05-13  
呵呵,这样的比赛有趣。
1 楼 Kaede 2008-05-13  
不知道为什么要用这些 脚本语言!
项目代码维护 多了一项,项目中多了一份依赖:(

相关推荐

    javaeye月刊2008年5月 总第3期.pdf

    8. **Groovy, JRuby, Jython, Scala:谁是胜利者?**: - 这篇文章可能分析了这些JVM上的动态语言,讨论了各自的优缺点,以及它们在不同场景下的适用性。 9. **《Effective Java》:Joshua Bloch访谈**: - ...

    基于Java平台的多语言混合编程.pdf

    4. Scala:基于JVM的静态类型语言,支持面向对象编程和函数式编程。 5. Clojure:基于JVM的动态类型语言,支持函数式编程和基于宏的 metabrogramming。 Java平台的多语言混合编程的未来发展趋势是: 1. 软件项目的...

    java脚本编程

    不过,Java生态系统中有多种脚本语言可以运行在Java平台上,例如Groovy、JRuby等。下面将详细介绍这些概念和技术。 ### Java与脚本语言 #### Java简介 Java是一种广泛使用的通用编程语言,由Sun Microsystems开发...

    聊聊Java平台上的非Java语言共3页.pdf.zip

    例如,Kotlin在Android开发中受到青睐,Scala在大数据处理领域广泛应用,而Jython和JRuby则为那些希望在Java平台上使用Python或Ruby语法的开发者提供了便利。了解并熟练掌握这些非Java语言,可以极大地拓宽开发者在...

    [JavaFX.2.0:Introduction.by.Example].Carl.Dea.文字版.pdf

    - **多语言支持**:除了Java之外,JavaFX 2.0还支持其他运行在Java虚拟机(JVM)上的语言,如Visage、Jython、Groovy、JRuby和Scala等,这增加了其灵活性和适用范围。 - **企业级应用**:Oracle公司明确表示,JavaFX...

    EvolvingTheJavaPlatform-OlaBini.pdf

    language、CAL、Aardappel、Funnel、MiniPLAN、SixxBDC Scheme、ABCL、Lisp、...Groovy、Nice、Scala、Anvil、Self、Hojo、Correlate、MetaJS、Sather、Quercus、FScript、Sleep、WLShell、JudoScript、JRuby、Jickle、...

    javafx_2.0_introduction_by_example

    JavaFX 2.0的关键架构策略包括对现有Java库的再利用和与其他运行在Java虚拟机(JVM)上的语言(如Visage、Jython、Groovy、JRuby和Scala)之间的通信桥接。这种设计思路使得JavaFX能够更好地融入现有的Java生态系统...

    jdk1.7.0_80.zip

    1. **多语言支持**:Java 7增加了对其他编程语言的支持,如Scala、Groovy等,通过JVM上的语言互操作性(JRuby, Jython等),使得开发者可以更灵活地选择编程语言。 2. **类型推断**:Java 7引入了钻石操作符(),...

    基础篇.pdf

    除了Java,JVM还支持Kotlin、Groovy、JRuby、Jython、Scala等其他语言。值传递和引用传递是参数传递的两种方式,Java中所有参数传递都是值传递,即使是对象也是对象引用的副本。 Java的基本数据类型有8种,包括整型...

    jdk-7u76-linux-x64.tar.gz.zip

    4. **动态类型语言支持**:如Groovy、Scala等,可以通过JRuby或Jython支持动态语言。 5. **字符串改进**:如`switch`语句支持字符串,`String`的`split()`方法性能提升等。 了解和掌握JDK的使用是成为Java开发者的...

    Java 工程师成神之路!.docx

    - JVM还支持其他语言,如Kotlin、Groovy、JRuby、Jython和Scala。 2. **基础知识**: - **基本数据类型**包括整型(byte、short、int、long)、浮点型(float、double)、布尔型(boolean)和字符型(char)。...

    JWebAssembly:Java字节码到WebAssembly编译器

    它可以编译任何可编译为Java字节码的语言,例如Clojure,Groovy,JRuby,Jython,Kotlin和Scala。 作为输出,它生成二进制格式(.wasm文件)或文本格式(.wat文件)。 目标是通过WebAssembly在浏览器中本机运行Java...

    jvmscripter:servlet webapps的远程脚本

    脚本编写器 用于 servlet webapps 的 REST 远程脚本。 支持的语言:Javascript (Rhino)、Groovy、BeanShell ... 即将推出:Scala、JRuby、Jython。 使用 Spray.io、Akka、AngularJS 和 Ace 编辑器在 Scala 中实现。

    ava程序员的未来_走向混合编程时代

    JVM平台经历了编程语言的巨大变化,出现了许多新的语言,包括动态语言如Javascript、Jruby、Jython、Groovy,以及函数式与面向对象兼具的Scala。这些语言为Java平台上多语言混合编程的发展提供了坚实的技术基础。每...

    GIAC 2016 - Java生态圈与微服务-丁雪丰-1.1.pdf

    这一平台为各种其他语言如Groovy、Scala、JRuby、Jython、Clojure、Ceylon和Kotlin等提供了运行环境,形成了丰富的生态系统。这些语言在保留Java平台优势的同时,也引入了各自的特性和语法糖,满足不同开发者的需求...

    The_Dalvik_Virtual_Machine

    例如Scala、Groovy、JRuby、Jython和Clojure等众多语言都可以在JVM上运行,并能够充分利用JVM的许多特性以及标准Java库和无数由个人和组织创建的定制库。 然而,近年来Google却逐渐偏离了这一趋势,开始创建非标准...

    【Java】超越 Java

    在“后Java时代”,作者可能探讨了诸如Scala、Kotlin、Groovy等现代JVM语言,它们在语法简洁性、类型系统、函数式编程特性等方面对Java进行了改进。此外,也可能提到了跨语言集成,如使用Jython或JRuby实现动态脚本...

Global site tag (gtag.js) - Google Analytics