You are viewing a read-only archive of the Blogs.Harvard network. Learn more.
Skip to content

Rhino JavaScripting on OS X

From Ranchero’s Weblog I saw this Weblog Entry on getting the Rhino JavaScript engine setup in OS X. This is pretty neat especially for people who are heavy into ECMA/JavaScript hacking as it allows them to leverage all of their sensibilities of JavaScript for doing scripting tasks.

The breakdown of tasks you need to do are:

  1. Grab the Rhino Tarball from the Mozilla site
  2. Then do some customizations to your shell environment to be able to run it easily

One thing to note is that Rhino relies on a Java VM to be installed as it is basically a JAR file with a bunch of extra functionality. One bonus for OS X is that Java is already installed with OS X (isn’t it nice not having to go hunting around Sun’s website looking for a bloody JVM then waiting for some huuuuge download to finish?). However a detractor is that it’s Java. I’ve tried writing some command line tools using Java and I find them clunky as you have to do lots of annoying contortions to just run it correctly at the command line. For a seasoned Java programmer it’s probably business as usual…

However, I already know my way around Ruby, Python, and am fluent enough in plain Bourne SHell syntax that I don’t see the point of adding yet another tool to compete with my CLI tasks. Right now, I’ve truly decided on Ruby as my scripting language once it gets outside of the realm of too much difficult logic in Bourne Shell (I still use this when the needs are simple). I like Python but it sucks trying to get Python working properly in a command pipeline. But if you do the normal, write a file, then run it in the interpreter it won’t make a big difference. OR if you use some fancy IDE.

But either way, choice is good and I’m sure JavaScript fans will be able to benefit most from this

Link to getting JavaScript up on OS X

Be Sociable, Share!