News for hackers. Stuff that matters.
Re:Node.cs - a C# version of Node.js by MarkSweep on Sunday March 11, 2012 @05:41PM (#3691375)
The 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

Re:Node.cs - a C# version of Node.js by aaronblohowiak on Sunday March 11, 2012 @05:42PM (#3691380)
you can also do this in luvit (libuv + lua)
Re:Node.cs - a C# version of Node.js by omgtehlion on Sunday March 11, 2012 @04:45PM (#3691231)
I 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.
Re:Node.cs - a C# version of Node.js by zedr on Sunday March 11, 2012 @04:49PM (#3691246)
Not 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.
Re:Node.cs - a C# version of Node.js by AntiRush on Sunday March 11, 2012 @05:01PM (#3691274)
There are various C# solutions for frontend web development.

SharpKit[1] is probably the most mature.

[1] http://sharpkit.net/

Re:Node.cs - a C# version of Node.js by thepumpkin1979 on Sunday March 11, 2012 @05:57PM (#3691412)
I 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.
Re:Node.cs - a C# version of Node.js by thepumpkin1979 on Monday March 12, 2012 @01:42AM (#3692467)
Why the downvoting?
Re:Node.cs - a C# version of Node.js by pjmlp on Sunday March 11, 2012 @05:12PM (#3691300)
Yeah, for the developers that have a brain small enough to handle multiple programming languages.
Re:Node.cs - a C# version of Node.js by petercooper on Sunday March 11, 2012 @06:44PM (#3691501)
Similar in C++11: 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-s...

Re:Node.cs - a C# version of Node.js by johnmmurray on Sunday March 11, 2012 @04:37PM (#3691213)
Is 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.
Re:Node.cs - a C# version of Node.js by johns on Sunday March 11, 2012 @11:09PM (#3692185)
A 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

Re:Node.cs - a C# version of Node.js by hinathan on Sunday March 11, 2012 @05:21PM (#3691324)
While 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
Re:Node.cs - a C# version of Node.js by equark on Sunday March 11, 2012 @11:24PM (#3692220)
Adopting Node's callback style seems like a very strange choice for C# where you have native async/await support.
Re:Node.cs - a C# version of Node.js by dos1 on Sunday March 11, 2012 @04:55PM (#3691259)
Node.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

Re:Node.cs - a C# version of Node.js by barrydahlberg on Sunday March 11, 2012 @07:40PM (#3691652)
Being able to write C# instead of JS is a pretty big point IMHO.
Re:Node.cs - a C# version of Node.js by lwat on Sunday March 11, 2012 @10:13PM (#3692071)
What do you gain in using this that you could not already do (better) on .net?
Re:Node.cs - a C# version of Node.js by fleitz on Sunday March 11, 2012 @10:42PM (#3692131)
You don't gain anything what you lose is a bunch of overhead. It's the same advantages/disadvantages you get from sinatra vs. rails.
Re:Node.cs - a C# version of Node.js by lwat on Sunday March 11, 2012 @10:57PM (#3692164)
.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.
Re:Node.cs - a C# version of Node.js by bad_user on Monday March 12, 2012 @04:36AM (#3692731)
It'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/

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.

Re:Node.cs - a C# version of Node.js by antihero on Monday March 12, 2012 @05:08AM (#3692778)
Out of interest, do you know if the people at Stack Overflow had these issues?
Re:Node.cs - a C# version of Node.js by sequence7 on Wednesday March 14, 2012 @08:25AM (#3702824)
If you read the errata of that post you'll see that the author could have got to 390 requests a second by turning off debug mode. No ugly optimisations necessary.
Re:Node.cs - a C# version of Node.js by barrydahlberg on Monday March 12, 2012 @09:37AM (#3693428)
I have not looked at this framework in particular sorry, I was only really commenting on JS vs. C# here.
Re:Node.cs - a C# version of Node.js by plasma on Sunday March 11, 2012 @05:09PM (#3691292)
I recently came across SignalR, it's a very well written and simple framework to use.

The buzzwords are web sockets, comet, ajax push, etc.

Re:Node.cs - a C# version of Node.js by mxweas on Sunday March 11, 2012 @04:41PM (#3691221)
holy god no...
Re:Node.cs - a C# version of Node.js by adestefan on Sunday March 11, 2012 @05:43PM (#3691383)
I say the same thing about writing backend code in JavaScript.
Re:Node.cs - a C# version of Node.js by theon144 on Sunday March 11, 2012 @05:55PM (#3691406)
Why? (Honest question, I don't know much about JavaScript or backend development)