Cool stuff. Really, though, this is still relying on a rather large runtime library: the physical, data-link, and network-layer drivers.<p>Now what'd be really awesome to see, would be one of those Operating System guides that shows you how to write an OS kernel, in assembler, that can speak HTTP. Even just limiting yourself to targeting the synthetic hardware of a VM program, it'd still be quite a feat.<p>Bonus points if the entire network stack has been flattened using the hand-rolled equivalent of stream-fusion. :)
Here's another simpler implementation of an HTTP server in Linux x86 assembly from last year, coincidentally by the one who did the Seiken Densetsu 3/Secret of Mana 3 translation hack and the old Starscream 68k emulator:<p><a href="http://www.neillcorlett.com/etc/mohttpd.asm.txt" rel="nofollow">http://www.neillcorlett.com/etc/mohttpd.asm.txt</a><p>And a not so successful thread to go with it: <a href="https://news.ycombinator.com/item?id=4714971" rel="nofollow">https://news.ycombinator.com/item?id=4714971</a>
I hacked on httpdito some more, and it has been improved in several ways:<p>- it now forks so that it can handle multiple concurrent connections (up to a limit of 2048);<p>- it no longer uses libc at all, so it's down to 2088 bytes (I had it lower, but then I added forking);<p>- it's less complex now that it only has one way of invoking system calls instead of two;<p>- there are some performance results in the comments.<p>- it has a name, "httpdito";<p>- strlen works correctly.<p>Probably nobody will read this comment here, but I thought it was worth mentioning.
Very cool I think. But cooler, Web Server on a FPGA, without CPU, only VHDL <a href="http://www.youtube.com/watch?v=7syu5EC1OWg" rel="nofollow">http://www.youtube.com/watch?v=7syu5EC1OWg</a>
Cool!<p>My comments as an inexperienced assembly developer, assuming this is optimising for binary size:<p>- The pug/doN macros do an extra reg-reg copy if passed a register - and the recursive definition calls pop/pop/pop instead of just add %esp, -4*N, you could shave a few bytes<p>- AT&T syntax will always look weird to me, but the heavy use of macros and local labels is quite elegant<p>- A little bit of candid swearing in the comments? Fine by me, but is this officially associated with canonical?
As a web developer who isn't familiar with assembly or any web server more barebones than nginx, what benefits does something like this provide? Speed? Could this be a solution for an extremely simple directory/static file web server?
and I just got finished rewriting all my large webapps in some obscure Java framework for performance, because of some benchmarks I saw on HN. Guess now I have to rewrite it all in assembly, because more performance is always better right?