

Why You Should Pay Attention to Node.Js - thekguy
http://redmonk.com/sogrady/2010/05/13/node-js/

======
CitizenKane
Something I feel that is significant and only touched on tangentially is that
there are a _ton_ of javascript programmers out there. If Node.js or a project
like it becomes successful it could provide a very easy mechanism for all the
javascript programmers to do server side software as well. It's something that
could significantly alter the web programming ecosystem.

~~~
awt
It seems like knowing the syntax of whatever language you're doing server
programming is not the most important aspect of server side development. It's
a really different skill set than what javascript has been used for up to now.

~~~
CitizenKane
To a degree perhaps. However, Node.js has a programming style that's highly
reminiscent of code you would see in a browser. For instance, responding to a
conenct event on a socket

    
    
      socket.addListener("connect", function () {
        socket.write("hello\r\n");
      });
    

is really not that different from responding to a click event on an element in
jQuery.

    
    
      $("#my-element").click(function() {
        alert('Element Clicked!');
      });
    

I'm not saying that it will instantly make everyone a server side programmer,
but it definitely makes the barrier to entry quite a bit lower.

~~~
fauigerzigerk
I don't see how that is much different, syntactically, from:

    
    
      public void service(ServletRequest req, ServletResponse res) throws IOException {
        res.getWriter().println("hello");
      }
    

Yes, JavaScript is dynamically typed so you don't have to type the types.

------
Kilimanjaro
They are missing the JS-on-the-server boat for being too focused on pleasing
asynchronous-rocket-scientists while the web is simply asking for plain JS.

All the web world need is a way to print('<h1>Hello world</h1>') easily, no
need to create servers and listen to ports to just spit some html, and there
is where node fails.

V8CGI is an interesting option but lacks penetration.

Google could hit a home run if they provide NATIVE js on app engine (not rhino
on top of Java)

~~~
mcav
So you want it to run per-request like PHP?

~~~
Kilimanjaro
Personally, I don't care how it runs as long as I can code JS on the server as
easy as php.

I'll be more explicit, this is all I want:

    
    
      - open editor and type:
      - response.write("<h1>Hello world!</h1>")
      - save it as hello.js and run it
    

See? nothing else.

Right now V8CGI is the closest to my dream I've found.

~~~
rythie
I don't see why someone couldn't create that as a layer on top of what Node.js
already does since it's just a special case.

~~~
Kilimanjaro
Exactly my point.

Node is cool and stuff, but lacking the layer of simplicity Joe scripter needs
to write his family album or personal shop.

Abstract everything from me and just let me write html (without having to use
any framework)

And no, it is not a special case, it is what 99% of web scripters today need.
The other one percent are those who lurk around node.js in google groups, the
brains behind the monster, the ones who want to compete with nginx and apache,
those building frameworks and utilities, not the ones who write casual stuff
who take a look and decide to go shopping while something easier comes along,
count me among them.

------
stanleydrew
This post alludes to performance faster than nginx. Anybody have any real-
world experience comparing the two? I'd love to hear about it if so...

~~~
grayrest
I'm also interested since I've never seen it benched faster than nginx. It's
usually about 80% of the speed on echo benches, but there's an ongoing email
thread about response latency causing major slowdowns, so perf improvements
are ongoing.

It's still far faster than anything else I've used as far as response time.
The other dynamic languages don't run as fast and it lacks the layers of
filtering/abstraction that bog down the compiled languges.

~~~
sogrady
See slides 4-6 in Ryan's presentation (<http://nodejs.org/cinco_de_node.pdf>).
He caveated the comparison heavily, and also took pains to note the vast
differential in memory consumption.

------
sandGorgon
Is this a replacement for stuff like Python's eventlet, etc. ? I mean, if I am
not building a web-app (but a network app nevertheless), does it still make
sense to use Node.js ?

For example, someone wrote the same example in eventlet, gevent, node.js,
eventmachine, tornado and twisted. <http://gist.github.com/376416>

it's pretty obvious how to use gevent from your python code, how does one use
node.js (without resorting to web frameworks, like Django etc.)

~~~
nwhite
<http://expressjs.com/intro.html>

------
leif
Could someone please hurry up and write a well-supported, popular lisp that
compiles to javascript and runs on V8 (it could be friends with clojure)? I
hate hate hate javascript's syntax and object model, but evented I/O in a lisp
would be heavenly to work with.

~~~
pkulak
Personally, I think CoffeeScript is close to the perfect syntax for a
language.

------
nwmcsween
"Implicit in node is a fundamental rejection of traditional I/O. It’s pushing
an asynchronous agenda with its event loops, based on the assumption that
concurrency cannot be achieved with a thread per connection" This is actually
very very wrong event based using kqueue/epool in 'modern operating systems'
(read:monolithic/hybrid/posix) takes ~ 8 system calls while a threaded
approach takes about 2/3 of that to do the same.

------
mark_l_watson
Cool writeup. I am enthusiastic about node.js and I have Heroku node.js beta
access - now all I need is more free time.

Javascript and node.js have a nice development story and I am trying to spin
up a bit on Emacs support for Javascript.

------
c00p3r
mod_v8 for nginx would be much better idea. Or, state it differently, v8 +
nginx portable runtime.

It is better to put together what is great, than reinvent the wheel.

~~~
felixge
The author of nginx, Igor Sysoev, actually investigated on this and decided
creating contexts in V8 is too slow (2ms) for being used in such a manner:

[http://translate.google.ru/translate?js=y&prev=_t&hl...](http://translate.google.ru/translate?js=y&prev=_t&hl=ru&ie=UTF-8&layout=1&eotf=1&u=http://sysoev.ru/prog/v8.html&sl=ru&tl=en)

~~~
c00p3r
V8 is open source, and I think they will be happy to incorporate some
performance enhancement patches. =)

