Taritsyn / JavaScriptEngineSwitcher

JavaScript Engine Switcher determines unified interface for access to the basic features of popular JavaScript engines. This library allows you to quickly and easily switch to using of another JavaScript engine.
Apache License 2.0
440 stars 49 forks source link

NodeJS as a JS Engine? #39

Closed asmagin closed 7 years ago

asmagin commented 7 years ago

Hi @Taritsyn, do you think it makes sense to implement standalone NodeJs server as an option of a JS engine?

Taritsyn commented 7 years ago

Hello, Alex!

Bad idea. Why waste the resources for I/O, when there are already modules supporting V8 engine: JavaScriptEngineSwitcher.V8 and JavaScriptEngineSwitcher.Vroom?

asmagin commented 7 years ago

I understand that you will pay some toll on I/O. However, you will be able to scale those engines independently and outside Windows server.

Taritsyn commented 7 years ago

Nobody prevents you from making your own unofficial module, that implements this functionality. I don't plan to develop such a module.

If you just need Linux and OS X support, then try the JavaScriptEngineSwitcher.ChakraCore module.

asmagin commented 7 years ago

Let's leave implementation efforts questions aside.

I'm using your module as a part of Sitecore CMS and Linux is not an option for its core, even dotNet Core is not there yet. On the other side application is have by itself, licensing doesn't make it easier as well.

I just would like to get you perspective it on such approach as it was actually a path that Microsoft took in JavaScriptServices.

As you've been working on JS switcher for quite a while, you know it inside out. So you think that you will have only performance problems from such approach?

Taritsyn commented 7 years ago

If you need this functionality, then implement your own unofficial module. You just need to inherit the JsEngineBase abstract class, implement the IJsEngineFactory interface and make your own version of the JsEngineFactoryCollectionExtensions class. If you will publish your unofficial module, then add a .Unofficial suffix to the name of package.

I also recommend to you see the Edge.js project.

Taritsyn commented 6 years ago

Hello, Alex!

If you have problems with performance of the ReactJS.NET, then I recommend to watch this video in Russian language (ReactJS.NET's presentation starts from 83rd minute).

asmagin commented 6 years ago

Thanks, will check it out.