phpstack - A TCP/IP Stack and Web Server in PHP
Adam Dunkels writes "Following the
trend of writing 'inappropriate' programs in the PHP scripting language, I have written a small TCP/IP stack and a web server entirely in PHP. It is extremely stripped down: the IP stack only implements the most basic functionality required for running the web server and the web server cannot handle pages larger than 1.5k. Nevertheless, the stack is able to support an unlimited number of simultaneous TCP connections and the web server has support for PHP scripting. A live demonstration server is up and running the phpstack software."
Why is it that people with this much time and smarts on their hands aren't out curing cancer, making the world safe from terrorists, and/or defeating SCO/RIAA/inapproprate software patents? Heck, even finding the killer of OJ's wife would make for good news and worthwhile effort.
"It's the height of ridiculousness to say for those 9 lines you get hundreds of millions."
All I can say is this is a completely misdirected use of talent. You're right, no one should be stupid enough to do this. I always get a laugh when someone points at Nanoweb (another webserver in php) and the authors actually have the balls to say it's "fast and robust". That guy has been the laughing stock of #php/Freenode for a while now, second only to the author of PHPNuke, for obvious repeat security issues.
As a proof of concept, well, _anyone_ with some knowledge of PHP could have _told_ you it could be done. Those same people with enough knowledge to know it could be done also would have told you _not to do it_. It's impractical, and a total waste of time to do what you've done.
Not only do you incur the overhead of the interpreter, which is rather nasty all on it's own, but PHP has lousy garbage collection, and is not meant to write applications with a sustained runtime. I'm very surprised it hasn't crashed.
I do love the php language for it's simplicity, and ease of use. As a web developer, it has aided me greatly, and I've done much with it. However, we should get back to using it for what it's actually meant for, building great websites.
BeauHD. Worst editor since kdawson.