2010/12/13

Idea: scripting for the rest of us.

Rhino has had continuations for a long time now. JavaScript is the language of the web. However, long-running executions are generally only discussed in the context of business processes, whereas in fact anything can be a long-running process.

For example, against an API for a hypothetical group todo list/document review tool (getActions, followupActions, review, distribute), a regular committee or meeting can be run like this:
var minutes;
while( ! disbanded) {
var oldActions = followupActions(minutes == null ? null : minutes.actions);
var newActions = getActions(participants);
minutes = {actions: newActions.join(oldActions)};
var accepted = false;
do {

accepted = review(minutes);
} while( ! accepted);
distribute(minutes);
sleep(1*month);
}

This could be for a school board, church council, or whatever. Also, you can use this format to (e.g.) organise rotas, timetables, casual chess tournaments, games of hide-and-seek or anything else.

In practise the API would be far more general than the one posited above, and the four methods above would themselves be functions.

I think that you could use this mechanism to do games, interesting projects or social activities with the Facebook API, for example. You could publish scripts, and scripts of scripts or libraries of functions, oh my! All kinds of interesting things. Anyway, I made some mockups of a potential iPhone application using this tool since it's probably the closest I'll ever get to actually building something like this. This is what would happen when you load a script (the user is responding to an invitation and has just clicked on "view source" to see what s/he is being invited to participate in):

And this is what happens when running a script (likewise the user has clicked/expanded "you are here"):

Would be interesting, no?

2010/12/11

Idea: decentralised P2P website mirroring

The recent case of Wikileaks being booted off AWS provoked the following thought: if lots of people started mirroring wikileaks on EC2, Amazon would be forced into playing whack-a-mole to stop it. Game over: the revolt of a user-base, the inevitable collateral damage, etc. leads to bad PR and (hopefully) reform and vertebrates. Amazon's nice GUI combined with their introductory offer making a micro instance basically free for a year, means that putting up a how-to page/YouTube video showing every college kid with a credit card how to do it can't be too difficult.

My question is, what next? How to you turn a swarm of small, transient mirrors into something findable and load-balanced to deal with the (potentially) huge demand of serving Wikileaks traffic?

Therein lies an interesting problem. First and foremost the question of how you resolve a stable domain to one of a set of highly dynamic addresses is a difficult one. Round-robin DNS load-balancing with a very short TTL is one obvious approach, but this begs the question of how one boot-straps and then maintains the CNAME record containing the list of mirrors. The stable domain could be a CNAME to DNS servers that are themselves part of the mirroring swarm, if each node acted as both a DNS and an HTTP server. Each node would return a randomised list of the nodes in it's topological neighborhood.

Apart from that, I'm not much further along in my thinking. Posadis could be used to implement a simple DNS server - the sample code can practically be copy-pasted by anyone who knows a bit of C++. The P2P network should be easy to do - any DHT should be usable, provided it has an API call to get the list of nodes, since the goal is not really to store information but just to maintain a single cluster of machines that know about each other. But the boot-strapping problem remains.

2010/12/08

Thoughts on WikiLeaks

  1. We should be more outraged at the malfeasance revealed than at the manner in which we learnt of it. That we aren't, speaks to our cynicism and the low-to-nonexistent standards to which we hold government.

  2. It was EveryDNS, not EasyDNS.

  3. Much as I love Amazon AWS (see many, many previous posts), their justification for booting out WL is disappointing, because (a) the cause (Lieberman's call) and effect is there for all to see, and (b) they didn't boot WL off because of the Iraq or Afghanistan war logs, which were also violations of the TOS, six months ago. Besides which, they have a business interest in a robust first amendment - they sell books, including dangerous and subversive ones containing state secrets! This isn't hard people!

  4. As Tim Bray said, the spinelessness of the IT industry in general is depressing when one considers that we should have "freedom of speech" in our DNA.

  5. The following ideas are not contradictory:
  • Cablegate is not necessarily a good thing
  • The way in which various governments and their officials have responded to it is an attack on the freedom of information and on the free press.
  • Julian Assange can be (a) a scumbag rapist, (b) justifiably paranoid, (c) a raging egotist and (d) doing really important work, all at the same time.
Good thinkers on the subject include Clay Shirky and Glenn Greenwald.