DEV Community

Adam Crockett 🌀
Adam Crockett 🌀

Posted on • Edited on

🦏 Mozilla Rhino JS makes me scream 😱

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.

...😂🦏😬

Top comments (6)

Collapse
 
flugruger profile image
wshallwshall • Edited

Rhino handles about a third of your healthcare records. (Scare you?)
It is the heart of the open source Mirth Connect HL7 integration engine.
It supports most ES5 (2009) language, but does have bugs.

Volunteer developers keep working to add more support. The latest version, 1.7.14, supports only 42% of ES6 (2015) and 30% of ES2018.

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

Would that not be confidential information?

I am UK based so it hopefully doesn't use Rhino

Collapse
 
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.

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

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

Collapse
 
ssimontis profile image
Scott Simontis

WebAssembly?

Thread Thread
 
adam_cyclones profile image
Adam Crockett 🌀 • 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 😂