News for hackers. Stuff that matters.
Re:Who is Using Node.js And Why? Yammer, Bocoup, Proxlet and... by Kilimanjaro on Saturday January 15, 2011 @01:32PM (#2107456)
For a ssjs implementation to win my heart this is how I would like to code my apps:

  require session,models,template

  function main(request,response){
    session.start()
    data = models.getEntries()
    html = template.render('blog',data)
    response.write(html)
  }
Can not be simpler, hide all complexities from the coder so he can concentrate on building apps, not fighting with code.
Re:Who is Using Node.js And Why? Yammer, Bocoup, Proxlet and... by Detrus on Saturday January 15, 2011 @08:59PM (#2108388)
Big discussion on that here http://news.ycombinator.com/item?id=2101210

Ryan was developing Node for certain use cases. He chose the name "Node" because it was supposed to be a small piece of a larger web app. A few nested callbacks, programs that have a few hundred lines of code and don't have complex control flows work well. Hype created a large community which is pushing beyond such narrow goals. But it will take time to come up with good DSLs or add continuations to V8. For now the best solution is to learn how to organize async code, for which I've only seen one trivial example.

Re:Who is Using Node.js And Why? Yammer, Bocoup, Proxlet and... by aaronblohowiak on Saturday January 15, 2011 @01:38PM (#2107466)
You can get close with expressjs
Re:Who is Using Node.js And Why? Yammer, Bocoup, Proxlet and... by Kilimanjaro on Saturday January 15, 2011 @02:36PM (#2107595)
I like it, it can be humanized a bit more like:

  var app = express.Application(); // let me create apps, not servers 
  app.get('/', app.do('index',req,res));
  app.run();  // set port in config.js
I'll keep an eye on express.
Re:Who is Using Node.js And Why? Yammer, Bocoup, Proxlet and... by foenix on Saturday January 15, 2011 @02:49PM (#2107627)
I can give express a thumbs up. I came from a python-flask environment, and express provided a way for me to quickly get the gist of javascript object-models and message passing.

(I'm not a CS guy, I just wanted to finish a digital art project involving buses and geolocation).

Re:Who is Using Node.js And Why? Yammer, Bocoup, Proxlet and... by yesbabyyes on Saturday January 15, 2011 @08:05PM (#2108286)
Combining express with http://jashkenas.github.com/coffee-script/ makes it really terse.
Re:Who is Using Node.js And Why? Yammer, Bocoup, Proxlet and... by isntitvacant on Saturday January 15, 2011 @08:54PM (#2108374)
something like this:

  var session = require('session'),
      models = require('models'),
      template = require('template');

  function main(request,response){
    session.start(
      models.getEntries.bind(models,
        template.render.bind(template, 'blog',
          response.write.bind(response))));
  }
would be easy to put together with node.js; it's functionally equivalent to the above (though it assumes that data comes into the template.render call as the last argument(s)), and neatly avoids too much nesting.
Re:Who is Using Node.js And Why? Yammer, Bocoup, Proxlet and... by armandososa on Saturday January 15, 2011 @03:06PM (#2107672)

    data = models.getEntries()
    html = template.render('blog',data)
I may be wrong, but these two lines has to be blocking
Re:Who is Using Node.js And Why? Yammer, Bocoup, Proxlet and... by Kilimanjaro on Saturday January 15, 2011 @03:25PM (#2107712)
That's the whole point, I don't care, hide that complexity from me. I can't render the page unless I have the data and I don't want to deal with callbacks, coroutines, monads, or what not, so I'll wait patiently for the data to come back.
Re:Who is Using Node.js And Why? Yammer, Bocoup, Proxlet and... by armandososa on Sunday January 16, 2011 @11:57PM (#2111260)
Well, yeah, I'd like to see that too. Just like ruby or PHP, only with JavaScript syntax.

Sorry for pointing the obvious;

Re:Who is Using Node.js And Why? Yammer, Bocoup, Proxlet and... by mishmash on Saturday January 15, 2011 @02:19PM (#2107570)
Let's see, braces and parens but no semi-colons, almost. ;)