News for hackers. Stuff that matters.
Re:To boldly go where Node man has gone before by ilaksh on Wednesday May 16, 2012 @07:49PM (#3984675)
I think that actually the Node example was significantly simpler.. there were no pointers, and no types needed to be specified. Also I can use CoffeeScript with Node. The only way Go is easier to write is if you know Go but don't know Node. I say its easier to learn and use Node/Javascript.

I am surprised that Node performed so well.. I would like to see that same Go benchmark with 4 CPUs vs. Node and also vs. Node with a clustered web server and the code to see how much more code that involves for clustering with Node.

Also I would like to see some Go code and benchmark that reads a file and/or database in the request and works efficiently.

Actually the code for a Node cluster that would use all of the available CPUs for http in CoffeeScript would look like this:

    cluster = require 'cluster'
    http = require 'http'

    numCPUs = require('os').cpus().length
    if cluster.isMaster
      cluster.fork() for i in [1..numCPUs]
    else
      app = http.createServer()
      app.on 'request', (req, res) ->
        res.end "hello world\n"
      app.listen 8000
Maybe someone could take V8, change it so it compiles (immediately) to static code and uses CoffeeScript, and add a way to optionally specify types (in an unambiguous and readable way) and pointers only when you have to.

There are no comments on this comment yet.