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

[color=red]原文地址[/color]:[url=http://blogs.sun.com/seapegasus/entry/groovy_jruby_jython_scala_who]Groovy, JRuby, Jython, Scala: Who Wins the Script Bowl? [/url]

  [size=medium][color=blue]简介:[/color] [/size]这是一场关于脚本语言的“擂台赛”(严格说,Scala应该不属于脚本语言), Guillaume LaForge代表Groovy,Charles Nutter代表JRuby,Frank Wierzbicki代表Jython以及Jorge Ortiz代表Scala。他们展开了三轮的竞赛,每次比赛他们都需要展示一个Demo,然后有三分钟的时间向观众解说这个Demo,而观众可以通过短信对比赛进行投票。
  这三轮比赛包括一个桌面应用,一个Web应用,以及一个自由发挥的项目用来展示各个脚步语言最擅长的东东。擂台赛的最后结果是:JRuby获得了第一,Groovy其次,然后是Scala与Jython。
[img]http://www.iteye.com/upload/picture/pic/14281/f3a88429-b601-3299-9a16-05be8682caa2.jpg?1210639370[/img]
A=Groovy, B=JRuby, C=Jython, D=Scala


[quote]Wednesday's [url=http://weblogs.java.net/blog/rags/archive/scriptbowlresults.jpg/voting.]Script Bowl [/url]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: [color=red]JRuby[/color]! [color=orange]Groovy[/color] comes second, then [color=blue]Scala[/color], and [color=violet]Jython[/color] ([url=http://weblogs.java.net/blog/rags]Check the final results in Rags' Blog, A=Groovy, B=JRuby, C=Jython, D=Scala[/url]). 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". [/quote]
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值