This presentation (read the presenter notes for context) introduces high-level patterns of distributed computation that are scale-invariant. More interestingly, it provides a number of links and says that all the patterns mentioned have been built in JavaScript. It concludes with a note that WebRTC makes it possible right now.
For those interested in the inner workings of the Kademlia Distributed Hash Table, which powers bittorrent amongst other things, slide 71 and onward are pretty enlightening.