Jan 6, 2011 at 3:23 PM

Can I use Jint to interprete NodeJS ?


Jan 6, 2011 at 3:34 PM

Node.js is not a Javascript file only, it's a console application which can run javascript programs, and comes with a set of API to manage resources.

Though it's totally feasible to do a clone of NodeJs on the windows platform using Jint:
- Create a console application called Node.exe taking a jacascript file as an argument
- Implement the API from Node in C#, and expose it by registering it to a JintEngine
- Implement all other Node APIs in C#, like CommonJs, ...

Then you could run any Node script.

But keep in mind that the only interest of Node is its performance, and the low level resource management event loop, so it will be hard to create the same stuff in C#. The goal here would be more a proof of concept to provide a native .NET implementation of NodeJs.

Jan 6, 2011 at 5:42 PM

Hey Seb,

Yes i agree with all your said, and the event loop reminds me of CQRS ring buffer style architecture.

Implementing the NodeJS API in C# is re-inventing the wheel. Kind of tiresome thing to do.

i was more looking for a way to leverage ANY JS in the same way that NiodeJS does it.



Jan 6, 2011 at 5:44 PM

Just want to add that here is a nice one using CQRS ring buffer


Why am in so into this stuff ?

Well, Multi core CPU is forced us to go from threading architectures to async messaging style architectures with a shared state SOMEWHERE.

I saw your project and instantly thought of the great single threading perf of NodeJS and thought it would be nice to leverage the two.