4 ms·
Node.cs - a C# version of Node.js
- johnmmurray 15y agoIs this still in active development? Looks like it hasn't gotten much attention in about a year or so. Wonder if the project has moved somewhere.
- mxweas 15y agoholy god no...
- omgtehlion 15y agoI suppose that main point in node.js is asynchronous execution, and in c# we already have all these features. I actually can’t see a point of this library in production app.
- zedr 15y agoNot only that, but one of the main selling points of Node.js is using one language (JavaScript) for both client and server programming: the holy grail of Web application development.
- AntiRush 15y agoThere are various C# solutions for frontend web development. SharpKit[1] is probably the most mature. [1] http://sharpkit.net/ http://sharpkit.net/
- pjmlp 15y agoYeah, for the developers that have a brain small enough to handle multiple programming languages.
- thepumpkin1979 15y agoI thought it was because Javascript didn't have a Threading model... that Javascript is also used in the Browser is just a coincidence I think.
- thepumpkin1979 15y agoWhy the downvoting?
- dos1 15y agoNode.js is becoming a first class citizen on Windows, so I'm not entirely sure what the point of this is. IISNode even allows you to host your Node.js apps in IIS. If you're desperate for some kind of evented web framework in C#, check out SignalR - https://github.com/SignalR/SignalR https://github.com/SignalR/SignalR
- plasma 15y agoI recently came across SignalR, it's a very well written and simple framework to use. The buzzwords are web sockets, comet, ajax push, etc.
- barrydahlberg 15y agoBeing able to write C# instead of JS is a pretty big point IMHO.
- lwat 15y agoWhat do you gain in using this that you could not already do (better) on .net?
- fleitz 15y agoYou don't gain anything what you lose is a bunch of overhead. It's the same advantages/disadvantages you get from sinatra vs. rails.
- lwat 15y ago.net is incredibly well optimised for web apps, with built-in connection pooling and countless other goodies. For anything non-trivial I'll bet that a normal .net application will blow this out of the water in terms of performance.
- bad_user 15y agoIt's not async and it is quite heavyweight. Your claim that ".net is incredibly well optimized" is true only for certain definitions. The output of a really simple ASP.NET MVC hello-world app is measured in a couple of hundred requests per second without even touching the database. If you do the same on top of Node.js or Netty or Twisted, you're speaking about tens or even hundreds of thousands of requests per second. For anything non-trivial I'll bet that a normal .net application will blow this out of the water in terms of performance. That's not true, not even if you're comparing ASP.NET with normal web frameworks, such as Ruby on Rails. You can get a lot of performance out of ASP.NET, but to do that you've got to rely on pretty ugly optimizations. To get a taste of what I'm talking about, check out this slightly old, but still relevant presentation: http://blog.whiletrue.com/2009/04/aspnet-mvc-performance/ http://blog.whiletrue.com/2009/04/aspnet-mvc-performance/ TL;DR the author went from 5.9 requests / second to 390 requests / second, but to do that they had to cut out many nice features of ASP.NET MVC that used runtime introspection and they also added caching, something which you do anyway in any other web framework available. Again, for some applications you can go fully async and speak about tens or hundreds of thousands of requests per second served by the same server.
- hinathan 15y agoWhile we're at it, I'll throw in my demo of node.js style closures triggered by events on I/O with PHP and libevent: https://github.com/hinathan/edges-php https://github.com/hinathan/edges-php
- MarkSweep 15y agoThe new await keyword in C# can be used to write coroutines libraries like this, but instead of you writing the continuations yourself, you can let the compiler slice up your function. You can then leverage the SynchronizationContext class to control which thread the continuations run on. Looking at the use of libtask in mongrel2 inspired me to play around with the idea of coroutines in C#. The await keyword makes my latest iteration quite small and nice to use. https://github.com/AustinWise/LibTaskNet https://github.com/AustinWise/LibTaskNet
- aaronblohowiak 15y agoyou can also do this in luvit (libuv + lua)
- petercooper 15y agoSimilar in C++11: https://github.com/d5/node.native https://github.com/d5/node.native And a simple example of using it (for a hello world benchmark): http://www.devthought.com/2012/02/08/node-http-hello-world-showdown/ http://www.devthought.com/2012/02/08/node-http-hello-world-s...
- johns 15y agoA more serious attempt at this was Manos de Mono which has also since been abandoned. With Node getting a lot of love from MS there's little need for a clone. https://github.com/jacksonh/manos https://github.com/jacksonh/manos
- equark 15y agoAdopting Node's callback style seems like a very strange choice for C# where you have native async/await support.