JVM Ruby vs. ECMA Ruby

Posted September 27, 2009

I've seen a few projects rearing up to try to port Ruby to JavaScript (such as HotRuby). This is all entertaining and everything, but here's a few problems as I see it:

  1. You are still limited to JavaScript's security model
  2. You are still limited to JavaScript's single-thread architecture
  3. JavaScript is already slow. Ruby is also slow. Slow + slow = molasses. (Please don't feed me "the language isn't slow, the implementation is" argument - I've already addressed that in another post).
  4. You cannot add custom functionality to the runtime

Using a Java Applet overcomes all of these limitations. In addition, JRuby is actually faster in a lot of tests than CRuby.

There's also the argument of having the "Java overhead" - this is a ridiculous argument. With Pack200, the JAR sizes are drastically reduced, and the Java plugin really doesn't take that long to load. Considering the advantages of it, so dismiss the entire idea because you're concerned about initial load times is bordering on insanity.

This is to be expected, though. For years now, Internet developers have had this unwarranted hatred for Java Applets without ever really thinking it through. "Nobody has Java installed" is a classic argument, but from all the statistics I've read, over 80% of all workstations already have the JRE installed. Hardly "nobody".

Web developers also have this peculiar love affair with JavaScript. Let's be honest - JavaScript is garbage. The "prototype" paradigm isn't even properly implemented. The differences in versions and implementations makes in convoluted to use effectively. Exception reporting is meaningless. There's no effective stacktrace. All-in-all it's a horrible environment for development - a lot of stumbling around in the dark.

Java Applets overcome all of this, and adding a scripting environment to it just makes more sense.

Comments

There are no comments for this post.

No comments found

Add comment

Visit my Friends and Family

If you've enjoyed my site, please take a moment to visit my friends and family, many of whom have some interesting insights, and entertaining thoughts and ideas.