Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to make Node.js use Rhino as the Javascript engine?

I use Node.js for several jobs on my web apps and so far everthing's ok.

But the Node.js uses Google's V8 as the default Javascript engine (JSE) and V8 runs exlusively on the x86 and ARM Instruction Set Architectures (ISA).

Now I have a PPC processor Mac computer on which I want to run the Node.js .

To do that, I'm adviced to use the Rhino + OpenJDK Shark Virtual Machine + Low Level Virtual Machine (LLVM) as the JIT compiler. Currently, that looks like the most applicable way of running Node.js on the PPC ISA. Or, is there a better way to do it?

Could you tell beforehand if it would be possible to make Node.js work with Rhino? Btw, Node.js is written in C++ and I do have the C++ programming experience, i.e. I may attempt to re-edit the code of Node.js if I have to.

Thanks.

like image 715
Terry Avatar asked Dec 04 '10 10:12

Terry


2 Answers

No, node.js is tied to V8, in almost every source file, and including all the add-ons that have been written. Even if you have the C++ experience, it would be a huge task to do the conversion.

Not to mention that, if you go down this path alone, you'll also be alone in maintaining it. (Whereas node.js itself has gathered a large community contributing.)

If you really want to put in that kind of effort, consider discussing it on the mailing list first. Or alternatively, gather momentum for a PPC port of V8. (An equally, if not more daunting task.)

For a server-side JavaScript engine that uses Rhino out of the box, take a look at the Narwhal project. (Though it seems less active.)

like image 117
Stéphan Kochen Avatar answered Sep 19 '22 15:09

Stéphan Kochen


There is an implementation of Node.js on Rhino called Rhinodo by MuleSoft.

But you no longer have to use Rhino as a backend for Node.js - there is a recent port of Node.js and V8 for PowerPC by Andrew Low (IBM).

like image 28
niutech Avatar answered Sep 18 '22 15:09

niutech