Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embedding JavaScript engine into .NET [closed]

People also ask

Can .net be used with JavaScript?

NET code can do virtually anything when combined with HTML and CSS but JavaScript is still very important and the reason lies in the different domains in which each language operates.

What is JavaScript engine switcher?

JavaScript Engine Switcher determines unified interface for access to the basic features of popular JavaScript engines (MSIE JavaScript Engine for . NET, Microsoft ClearScript. V8, Jurassic, Jint, ChakraCore, VroomJs and NiL. JS).

Is .NET same as JavaScript?

Javascript is a scripting language which runs in the browser while ASP.net runs on the server and is a framework for running web applications (you can compare it to JSP, ColdFusion etc etc) Just so you know....

How does JavaScript and JavaScript engine work in the browser and node?

JS code has to run in an environment, the most common ones are browsers and Node. js. The environment needs to have an engine, which takes the JS code that's written in human-readable syntax and turns it into machine code. The engine uses a parser to go through the code line by line and check if the syntax is correct.


Try Javascript .NET. It is hosted on GitHub It was originally hosted on CodePlex, here)

Project discussions: http://javascriptdotnet.codeplex.com/discussions

It implements Google V8. You can compile and run JavaScript directly from .NET code with it, and supply CLI objects to be used by the JavaScript code as well. It generates native code from JavaScript.


The open source JavaScript interpreter Jint (http://jint.codeplex.com) does exactly what you are looking for.

Edit:
The project has been entirely rewritten and is now hosted on Github at https://github.com/sebastienros/jint


You might also be interested in Microsoft ClearScript which is hosted on GitHub and published under the Ms-Pl licence.

I am no Microsoft fanboy, but I must admit that the V8 support has about the same functionnalities as Javascript.Net, and more important, the project is still maintained. As far as I am concerned, the support for delegates also functions better than with Spidermonkey-dotnet.

ps: It also support JScript and VBScript but we were not interested by this old stuff.

ps: It is compatible with .NET 4.0 and 4.5+


Anybody just tuning in check out Jurassic as well:

http://jurassic.codeplex.com/

edit: this has moved to github (and seems active at first glance)

https://github.com/paulbartrum/jurassic


You can try ironJS, looks promising although it is in heavy development. https://github.com/fholm/IronJS