TwIP - An IP Stack In a Tweet 81
Adam Dunkels writes "Inspired by the Twitter-sized program that crashes Mac OS X, I just wrote a really, really rudimentary IP stack called twIP, small enough to fit in a Twitter tweet. Although
twIP is very far away from a real IP stack,
it can do the first task of any IP stack: respond to
pings. The entire source code can be found in this 128-character-long tweet. For those who are interested in low-level network programming, a code walkthrough with instructions on how to run the code under FreeBSD is available here. The FAQ: Q: why? A: for fun."
Article mod: -1 Overrated (Score:5, Insightful)
The underlying system must provide a way for user programs to receive and send IP packets.
This is where I stopped reading. Just... no. This is just a program that echoes every single thing back to the originator.
Relevance check please (Score:5, Insightful)
Shit doesn't smell like roses when it is made to fits into a tweet or is in any other way related to Twitter.
At least 3 ways to make it smaller: (Score:3, Insightful)
Here comes the lameness filter:
unsigned short s[70];*l=s+6;t;main(){for(;;){read(0,s,140);s[10]&=65280;s[11]+=8;t=l[1];l[1]=*l;*l=t;write(1,s,140);}}
And with those 9 chars perhaps you could make it better.
Re:Novel, but pointless (Score:3, Insightful)
Re:Article mod: -1 Overrated (Score:5, Insightful)
Yeah, I've got a program for the author that fits in a tweet:
#include
int main() {
puts("You're a moron and a braggart.");
}
I hope this isn't a new trend. (Score:4, Insightful)
I hope this isn't a new trend of 7337 |-|@(|0%$ to try to brag of their mad skill by seeing what code can fit in a Tweet.
The less the code doesn't mean better performance.
The less code can mean less functionality and error checking.
The less code does mean less documentation
The less code could mean harder readability.
We need less people taking their time and effort making unreadable small code and more effort in making good and useful applications and libraries. Granted such exercises may be useful to allow you to think of problems differently but you can get the same effect by changing languages say from C to LISP. Also these examples seem to take in include headers which accounts for thousands of lines of code, which are often limited to either the OS or even just the Programming language.
It is like me saying I can make a Web Browser using a shell script with 2 lines.
#!/bin/bash
apachectl start
Very cool (Score:4, Insightful)
Re:I hope this isn't a new trend. (Score:5, Insightful)
If you converted Apache into a web browser that might actually be worthy of a story...
Re:Article mod: -1 Overrated (Score:3, Insightful)
using the IP stack that already exists on the OS.
Responding to IP requests using someone elses IP stack does not mean you actually created your own stack.
It's not an IP stack (Score:4, Insightful)
Re:A message to C haters (Score:4, Insightful)
I'm a c/c++ fan but just because you can do something in less lines doesn't mean it is better. Maybe if you said that in your language the mac crash ap compiles to 80bytes and requires only 10 operations then i'd be impressed. Buuuut in that case then asm is the greatest language ever.
Re:Article mod: -1 Overrated (Score:2, Insightful)
Apparently, slashdot could use a -1, Don't be a dick moderation.
Just give the story a - and move on.
Re:A message to C haters (Score:2, Insightful)
Please. Emacs can crash a Mac and create an IP stack in one command.