Node JS vs Rhino JS for Desktop Scripting

1,290 views
Skip to first unread message

GaryCrab

unread,
Oct 20, 2011, 1:00:14 PM10/20/11
to mozill...@googlegroups.com
Can anyone who has used Node.JS compare it to Rhino JS in the realm of simple scripting applications? e.g., calling java classes, ease of use, etc. The kind of thing you might write an impenetrable Perl script with.
 
Thanks in advance.

Jay Young

unread,
Oct 20, 2011, 4:30:34 PM10/20/11
to mozill...@googlegroups.com
Node isn't built on top of the JVM, so if you're looking to interop with Java, Rhino's one of the few choices out there (and it's a good choice, at that).

GaryCrab

unread,
Oct 20, 2011, 4:32:59 PM10/20/11
to mozill...@googlegroups.com
Thanks for the answer. That kind of extensibility is my favorite part of Rhino. I think node.js mimics it with a custom library of modules like those available for Perl or python.
 
However, what's odd is how much buzz there is around node.js (e.g., 1000+ posts in their group, mentioned in everyone's blog). It's pretty cool, but you rarely see the same with Rhino.

Daniel Friesen

unread,
Oct 20, 2011, 4:52:51 PM10/20/11
to mozill...@googlegroups.com
Probably because Rhino is just an engine, while Node.js is stuff on top
of an engine. Rhino is more like V8 which powers node.js. You don't see
people hyping V8 itself much.

~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]

Michael Schwartz

unread,
Oct 20, 2011, 4:56:17 PM10/20/11
to mozill...@googlegroups.com
Check out ringojs. It's something like nodejs but built for Rhino.

Tony Zakula

unread,
Oct 21, 2011, 7:24:30 PM10/21/11
to mozill...@googlegroups.com
There is also mynajs.org.

mykes

unread,
Dec 9, 2011, 9:21:54 AM12/9/11
to mozilla-rhino
And now there is SilkJS!

shameless plug, as is yours :)

https://github.com/mschwartz/SilkJS

GaryCrab

unread,
Dec 9, 2011, 9:42:44 AM12/9/11
to mozill...@googlegroups.com
I wasn't trying to plug anything. I think they're both terrific. I was just trying to find out which one was easier/more powerful for desktop utility scripting. If I have to do a perl/bash/python/powershell kind of thing, I'd rather use JavaScript.

Jeb Beich

unread,
Dec 9, 2011, 9:53:27 AM12/9/11
to mozill...@googlegroups.com
I do quite a bit with bash+rhino these days. Really loving rhino for
all my general purpose scripting...

--
Jeb Beich
http://www.red-source.net/jeb

Michael Schwartz

unread,
Dec 9, 2011, 10:01:16 AM12/9/11
to mozill...@googlegroups.com
I was responding to Tony re: MynaJS (which is very neat in its own right).

SilkJS is a thin layer of C++ glue around many of the Linux OS functions and other libraries (like MySQL and libgd2 and nurses). It's a fine replacement for shell scripting, and you can write JavaScript.

Gary Furash

unread,
Dec 9, 2011, 11:00:54 AM12/9/11
to mozill...@googlegroups.com
Hmm... Has anyone used both RHINO and NODE.JS for administrative-style
scripting (i.e., what you'd normally use Bash, PowerShell, Perl, etc. for)?
If not, I guess I'll be the one investing time to see which one is more
suited for it. I'm sure they can both do it.

Jeb, can you tell me a bit about what you do? Can you send me a sample
script or too? How did you setup rhino so that you can run .js scripts from
the command line.

Tony Zakula

unread,
Dec 9, 2011, 11:07:36 AM12/9/11
to mozill...@googlegroups.com
In my book, one of the biggest thing to consider about node is its
threading model.

Tony Z

Gary Furash

unread,
Dec 9, 2011, 11:08:38 AM12/9/11
to mozill...@googlegroups.com
Does threading come up much in desktop admin stuff (i.e., the stuff you'd normally use Bash, Perl, Python, etc. for).? I thought it was mostly for server type stuff.

Gary Furash, MBA | Mosaic HR Technical Team, University of Arizona: University Information Technology Services (UITS) | http://www.mosaic.arizona.edu | 520-907-2470 | fur...@email.arizona.edu

NOTICE: The information transmitted in this mail is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material.  Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited.  If you received this in error, please contact the sender and delete the material from your computer.

Jeb Beich

unread,
Dec 9, 2011, 11:10:26 AM12/9/11
to mozill...@googlegroups.com
I'm actually just starting to do a little bit of my scripting with
node so that I'll be able to compare (although as a Java dev, I think
I'll always be biased towards rhino).

I use rhino for pretty much anything I want to script. Most recently
was a script to scrape questions out of word docs. The script first
invoked a powershell script to convert the word doc to text, then just
did your average text parsing, and wrote the result to a file. In that
past, it's something I'd have used Python for.

Before that was a script that recursively searched some directory's
files for some text. It used linux's "find". The js was used for the
stuff I'd normally do with bash in that case: argument validation,
results formatting, etc.

In both windows and linux all I did was add the rhino interpreter
binary to my path so I'm able to do "rhino myscript.js" from wherever.

I'd be happy to send a few samples.

Jeb

On Fri, Dec 9, 2011 at 10:00 AM, Gary Furash <furas...@gmail.com> wrote:

--
Jeb Beich
http://www.red-source.net/jeb

Gary Furash

unread,
Dec 9, 2011, 11:13:40 AM12/9/11
to mozill...@googlegroups.com

Tony Zakula

unread,
Dec 9, 2011, 11:35:47 AM12/9/11
to mozill...@googlegroups.com
It is just a different way of coding. Scripts run async style so you
should be aware of that when you write your scripts.

For those who like that style of coding, it can easily be implemented
with Rhino as well.

Tony Z

Reply all
Reply to author
Forward
0 new messages