Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
The Internet Programming Technology

P2P In 15 Lines of Code 418

nile_list writes "Edward Felten of the very fine Freedom to Tinker has written a 15 line P2P program in Python. From the post on Freedom to Tinker, "I wrote TinyP2P to illustrate the difficulty of regulating peer-to-peer applications. Peer-to-peer apps can be very simple, and any moderately skilled programmer can write one, so attempts to ban their creation would be fruitless." Matthew Scala, a reader of Freedom to Tinker, has responded with the 9 line MoleSter, written in Perl."
This discussion has been archived. No new comments can be posted.

P2P In 15 Lines of Code

Comments Filter:
  • by jellomizer ( 103300 ) * on Wednesday December 15, 2004 @05:02PM (#11096708)
    15 Lines? 9 Lines.
    The python code has
    import sys, os, SimpleXMLRPCServer, xmlrpclib, re, hmac
    The perl code puts multiple commands in one line.

    Those are both cheating. And not really 15 or 9 lines of code. How many lines of code are just os.py alone? Using these upper level languages is not a good way to prove how simple these activates are because they use many complicated libraries preinstalled in the language. It is like saying I can write a webserver in 3 lines of code.
    #!/UpperlevelProgrammingLanguage
    Import webserver
    Run Webserver
    Version in lower level language like C with just say the <includes> are better but still a bit of cheating. If you did in in assembly then that is even fairer. The true test is how many lines of code in assembly without an OS.
  • by QangMartoq ( 614688 ) <SearchingBearCub@nOSPAm.gmail.com> on Wednesday December 15, 2004 @05:04PM (#11096750)
    As we saw when the courts tried to ban DeCSS, the code was printed onto t-shirts.

    I can see P2P becoming the next DeCSS in the eyes of the courts and receiving similar treatment.

    So when can I expect my shirt?

  • by Anonymous Coward on Wednesday December 15, 2004 @05:10PM (#11096834)
    wtf why did you pick "molester' as the name for your product. how about michaeljacksonster?
  • P2P tattoo (Score:4, Interesting)

    by Lord_Dweomer ( 648696 ) on Wednesday December 15, 2004 @05:15PM (#11096882) Homepage
    So I know that you can encode entire programs on barcodes. Well, could someone have a tattoo with this barcode on it for the program and carry it with them wherever they go? Even a temporary tattoo would be cool. Wearable computing takes on a whole new meaning, plus, you'd never be without access to free media.

  • by Anonymous Coward on Wednesday December 15, 2004 @05:32PM (#11097082)
    The link is intent. The notion that the RIAA/MPAA have is that makers of P2P applications are doing something complex and difficult, and so banning P2P applications isn't a big deal--it's a specialized activity that's hard to do, and it's relatively easy to police, and to demonstrate intent on behalf of the programmer.

    The goal of showing tha P2P applications are easy to write and can be extremely small is to say that you really can't ban P2P without banning the ability to transfer data over the internet in general. The idea here is that what's "core" to a P2P ap isn't all the fancy bells and whistles--it's a pretty simple and straightforward concept.

    The idea here is that if someone wanted to ban text editors, since they could potentially be used to copy down copyrighted information. They may say that their war is with Microsoft, and specifically Word. But the point is that you don't have to be Microsoft to write a text editor, and all those bells and whistles Microsoft writes aren't what makes it a word processor--it's the really simple concept of modifying text in a file. "edit" isn't nearly as complex, but does the same thing. The problem isn't with the big pieces of software but with the underlying concept.
  • by Anonymous Coward on Wednesday December 15, 2004 @05:35PM (#11097121)
    Fair enough if we were doing a coding competition to see who could write the smallest P2P client. But I think that would be missing the point of the article. The purpose of the 15 line P2P client is to demonstrate how easy it is to code a client, not how easy it is to smuggle one on a floppy.

    And as far as that goes, high level language code libraries aren't "hacks", they're a reality that has to be dealt with. The fact is, libraries for doing very compliated things exist and are easy to obtain. They make it possible for even people with limited programming experience to write fairly complicated programs without much effort.

    That's where RIAA and it's band of merry men have made a miscalculation. They believe that developing a P2P client is a difficult task which can only be done by experienced programmers. Thus they would only have to police only a small segment of the population to enforce laws against developing them. But as the 15 line P2P client demonstrates, the increasing complexity of high-level languages (and their included libraries) makes it much easier to develop a client than they think. So enforcement would be like trying to move an ocean with an eyedropper.
  • by Anonymous Coward on Wednesday December 15, 2004 @05:40PM (#11097197)
    I love how Orrin Hatch, a huge proponent of the NRA and the belief that "guns don't kill people, people kill people" (which I agree with), is the biggest pusher of the Induce Act, which implies that people don't violate copyright, software does. I want to puke.
  • by twistedcubic ( 577194 ) on Wednesday December 15, 2004 @05:51PM (#11097323)

    TinyP2P requires you specify the server address and port. Um, how is this different then FTPing to a server? Or sending a file over some IM service? Or copying a file over a network share?

    But, does there exist an ftp server you can trust? Seems like all of them have a root exploit discovered periodically. Likewise with the IM programs. However, 15 lines of code is pretty easy to audit.
  • by N3wsByt3 ( 758224 ) on Wednesday December 15, 2004 @08:43PM (#11098924) Journal
    I'ts all very insteresting to read about this, but I'm wondering... seems creating P2P is very simple, yet why takes it so long for people to take up the chalenge of making a 'small social network' P2P-system?

    Wasn't it on this veryè same slashdot, that not too long ago an article was mentioned about a site who was willing to pay a considerable amount of money to any coder willing to work on a OSS P2P system annex IM which was meant to be used in a small network of friends, and thus, below the radar of RIAA and co.

    I gather the author in question isn't very interested in money, at least compared to 'status among peers' (something that seems to be typical of good coders working on OSS projects, like Linus). But I can't imagine that NO coder (at least the last time I checked) has taken that offer up for 1000 bucks, while this one makes a simple P2P prog in a matter of days, just to prove a point, or even just for the fun of it.

    I'm not sure how it was called again, but some probably will remember and maybe post a link to it...now, the only thing to find are skala-type dudes - and getting a nice bonus on top. Volunteers?
  • by punxking ( 721508 ) on Wednesday December 15, 2004 @09:33PM (#11099294)
    With all due respect, can we mod the parent obtuse? I'm honestly not trying to troll or flame, but the self-righteousness of the parent post is a bit much considering the whole point was how quickly and easily a p2p app could be created (and by extension then discarded when need be). Whether or not the code is elegant is entirely beside the point. It could even be argued, given that something of this nature is potentially being created to circumvent certain rules or regulations, that the whole point is to make it such that only the interpreter/compiler can decipher it.

He has not acquired a fortune; the fortune has acquired him. -- Bion

Working...