DEV Community


🦏 Mozilla Rhino JS makes me scream 😱

Adam Crockett
I work at ForgeRock as Staff UI Engineer, I play with all sorts really. Lately WASM is my toy of interest.
・2 min read

Rhino is not JavaScript in my book.

Ouch that's a bold claim, what is it then?

Pure disparity, kidding let's dive in.

Before node.js was a twinkle in Ryan Dhal (the man who by extension paid for my house and car) we have had several efforts to bring JavaScript to the server side and most notably Java.

Java has always had a wired fetish for JavaScript either by trying to replace it in the browser or even run it on the serverside, like it was trying to swap places 🤷‍♂️ yes that's right Mozilla created Rhino JS 🦏 way back when.

Rhino is basically a JavaScript engine which has interoperability with Java, aka your airquote "JavaScript" can access Java and do Java things... Except time moves on, we have node now and a thriving ecosystem, in fact time has move on again, deno is billed to be the next big thing, but Rhino what's that?

Well let's dig into the issues other than its obsolete.
Rhino was supposed to be replaced by nashorn the ES6 compliant Java based engine... But somehow that was scrapped and Rhino as things go In Java land, un-deprecated itself!

Rhino has no active maintenance and yet plenty of active projects including any product using Adobe experience manager CMS running this ticking timebomb

You can't even hire js engineers because the have be as old as me and know es5 really well and a bit of ES6 but maybe 2% of it plus Java, it's useless.

What is scripting historicaly speaking? It's hiring non programmers to write Lua for c, it's inventing a language to handle higher level operations without compiling, it's an easier way to extend a subset of your program, does Rhino do this? No because java inside JavaScript isn't flawless, it introduces such awful situations as Java String casting to String, if you hadn't been bitten by this error, you would have no idea why your perfectly normal looking program doesn't work. But even debugging is a pain!!

Graal VM you are much more up to the job with your node.js running Java directly, I employee you, don't use Rhino, use Graal VM and enjoy a polyglot stack that everyone will enjoy.


Discussion (4)

abhinav1217 profile image
Abhinav Kulshreshtha

"Rhino JS" Now that's a name that jogged up memories. I remember using it as a unique feature point in my college minor project. That was few years before node even existed. Despite all its limitations (mostly because of lack of blog/tutorial coverage) I was fascinated with it. I was really happy when nashorn was announced. GraalVM on paper feels like right step, but in practice, I am kind of disappointed with it.

adam_cyclones profile image
Adam Crockett Author

I like rhino in some ways despite what I say, it's impressive engineering but sadly it has no replacement in EOL and that's the frustration for me

ssimontis profile image
Scott Simontis


Thread Thread
adam_cyclones profile image
Adam Crockett Author • Edited

Yes and no, Java can indeed run WASM through this port of WASI or there's a few other projects, tea VM, but there are and will for a long time be Java stacks and Java developers who want to stay well away from JavaScript, not a stereotype, I have worked in all Java houses for years and I get a lot of flack for liking JavaScript 😂

Forem Open with the Forem app