Oh, Cool

Dr. Edward Felten has come up with a wicked cool app on his blog, Freedom To Tinker. It’s called TinyP2P, and it’s a proof-of-concept demonstration of a really small peer-to-peer application.

A peer-to-peer application is one that allows two computers to (among other things) share files. There are varying degrees of sophistication to these critters, ranging from really simple ones (like TinyP2P) that just allow you to download a file, all the way up to distributed systems that allow you to pull bits of the file from several different servers simultaneously, thereby easing the network load on each individual computer and making for a fast and very fault-tolerant system for distributing really big files (like BitTorrent).

What makes TinyP2P noteworthy is that Dr. Felten wrote it to be as small as possible. It manages to implement a basic set of p2p features in only 15 lines of code. And prompted by this throwing down of the coding gauntlet, a couple of other hackers have created even shorter examples. Matt Skala created MoleSter in 9 lines of Perl. Florian Gross created an anonymous 6-line program in Ruby.

I stayed up until about 1:30 this morning trying to get TinyP2P to work on my system. It keeps throwing this odd error when I try to move files around. I’ve got to keep poking at it until I get it working. This stuff is fun.

No Responses to “Oh, Cool”

  1. David Says:

    It’s been a looooong time since I really dug into someone else’s code just for fun. For some reason, this program just fascinates me.

    I guess two of the things that strike me as so cool about this program is that he managed to avoid using any conditionals (if/else) by using Python’s evaluation of and and or. He also works in a lot of lambdas, which I have a hard time writing because I have a hard time imagining a function that only consists of statements.

  2. DocWhat Says:

    Yeah, some sort of bug in the XML parsing. I might take the time to tear it apart and build my own version….maybe.

    Dunno, got lots of started projects.