开发者

Why not Rhino for JVM apps?

开发者 https://www.devze.com 2023-01-07 06:39 出处:网络
I would like to develop some apps for the JVM using a concise, dynamic language. The 开发者_C百科most popular choices for this seem to be Jython, JRuby, Groovy, and maybe Clojure.

I would like to develop some apps for the JVM using a concise, dynamic language. The 开发者_C百科most popular choices for this seem to be Jython, JRuby, Groovy, and maybe Clojure.

Rhino appears to be fast and very stable, but I see no books on Rhino development and little discussion. Why is there apparently little use of JavaScript for other than embedded scripting?

Edit: I found this question informative on the viability of Rhino-based development.


I've used Rhino as a part of a production-grade VoiceXML interpreter written in Java and running on the JVM. It works extremely well for this purpose. If I were reimplementing this interpreter from scratch, I would have leaned towards doing even more of my development in JavaScript. So it's definitely an option. You'll need to explore how mature the surrounding libraries are for your application area (you can always write logic that calls out from JavaScript to Java libraries, but that might be too laborious).

But I also agree with @Peter Recore: do give the other JVM languages a second look. I'm impressed with the object-functional Scala language: its performance is nearly as good as Java, and it has a lot of expressive power.

Update: Good books to read on JavaScript are: JavaScript: The Definitive Guide and JavaScript: The Good Parts. The only Rhino-specific stuff you'll need is here.


I have never used Rhino so I can't offer technical reasons, but as a generic programmer, I can offer up a pop psychology theory:

For most of its life, javascript has been strictly a client side language, at least in people's heads. Even worse, it seemed like a crappy one, because there were always problems on web pages with javascript. These problems weren't necessarily the fault of the language so much as how the browsers implemented it, how they organized the dom, and what we were able to access through javascript. But in our heads we began to think "javascript has issues" or even just "javascript is limited in what it can do".

So despite all the high level magic some people can do with it, many of us think of javascript as a toy language, from our early memories of the web where all it could do was make an image change on a mouse rollover.

Finally, for a language to become popular,(especially when lacking a huge corporate sponsor) it needs to have some tangible benefit over the existing ones. There are already a lot of server side languages, frameworks, and runtimes competing for people's attention. What is so special about javascript that people should throw away their investments in technology X that they already use? (that's not a dig at js, just food for thought)

0

精彩评论

暂无评论...
验证码 换一张
取 消