Node.net - Node.js implemented in Javascript on the .NET runtime
github.com
github.com
I'm a .NET dev by trade but became immediately interested in Node.js for that very reason.
In the .NET case, a Node-like project is in an interesting position: lots of long-running/externally-bound third-party (and even a few first-party) APIs are blocking in nature, except that if they were following the design guidelines they would all provide non-blocking alternatives based on a set of implementation patterns provided by and followed in the .NET base class library itself. Those implementation patterns would be relatively easy to generically wrap into the kind of callback pattern used by Node.js.
At the very least, a project like this has a possibility of highlighting some of the places where only blocking APIs have been provided but non-blocking ones should have also been provided. On a slightly more optimistic note, a project like this has a chance of allowing more solutions to be built in the Node.js events-instead-of-threads style without having to jump ship to an entirely different runtime.
Honest question. I have no visibility into the .Net ecosystem and have no idea if threading is exceptional or normal.
That said, the thread safety isn't as critical in something like Node, at least not in the sense you'd usually be worried about, as the execution model is explicitly single-threaded. What you'd be more interested in finding (and pushing to improve) would be libraries that are externally bound but fail to provide an async option using the recommended async patterns for .NET. To be clear, these recommended async patterns and a good number of their proper implementations do not require hidden threads for their async behaviour, as when built correctly they are layered upon lower-level async operations that themselves do not require threads.
One would hope to work towards a "turtles all the way down" kind of scenario where eventually nothing you are using blocks on anything external and instead uses the async primitives and layers them up such that no threads are needed for any async operations. Admittedly, as .NET goes there would be areas you can't achieve that goal, however, as some framework bits are secretly backed by threads (e.g. some serial port handling, when last I checked), but this is also true in the case of Node.js which itself maintains threads behind the scenes for use with otherwise-unavoidable blocking code. In either Node-style case the end goal is the same: to minimize if not eliminate the need for such threads, and in the .NET-specific case it should be largely achievable (to the degree that it matters) as there are plenty of building blocks with proper async options.
And also, considering how HN is crazy about experimental languages, compilers, frameworks and combinations of them, I'm surprised with this question. The title of the post actually reminded me to the output of a certain HN title generator that was here a while ago.
http://newcome.wordpress.com/2010/05/08/node-net-node-js-imp...
Never underestimate the sheer power of easily circumventable abstractions ;-)