CascadiaJS 2013 is proudly brought to you by


You can view the rest of the videos on our2013 playlist on Youtube


Programming a Node Cluster Like It's One Really Big Computer

Abstract

Distributed programming is a lot easier if the abstraction makes the cluster look just like a really big computer.

I'll talk a little bit about some concepts from Cloud Haskell (and Erlang and Akka), and how they might look ported over to Node. The main idea is to be able to spawn many Processes which are automatically distributed across the cluster. Processes communicate via message passing, inspired by Erlang's "actor model".

One point of focus is serialization and transmission of function closures. For example, given a function add

var add = function(x) {
  return function(y) {
    return x + y + 1
  }
}

We should be able to partially apply it and transmit it elsewhere to have its second argument applied, then have the result returned back to us.

spawnRemote(add(1), function(err, result) {
  if (err) throw err
  console.log("Result computed remotely: ", result)
})

Serialization of a function closure is possible by serializing its environment (i.e. the bindings of its free variables) and a representation of its code.

Speaker Bio

neuman

Sr Software Engineer at Twitter, formerly at Twilio, board member at HIFY. Ideas man, Haskeller, a cynic with a bleeding heart.