Live data from Hacker News

TCP HTTP Server written in Assembly

canonical.org

11–20 of 74 posts

Re: TCP HTTP Server written in Assembly

#11
post #9

Cool! My comments as an inexperienced assembly developer, assuming this is optimising for binary size: - 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 - AT&T syntax will always look weird to me, but the heavy use of macros and local labels is quite elegant - A little bit of candid swearing i…

> - A little bit of candid swearing in the comments? Fine by me, but is this officially associated with canonical?

Assuming you mean Canonical Ltd., the company behind Ubuntu, this has absolutely nothing with them — this is hosted on canonical.org, not canonical.com.

Re: TCP HTTP Server written in Assembly

#12
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?

Re: TCP HTTP Server written in Assembly

#14
post #12

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?

This is not a very fast webserver. Anything using sendfile() and threads/processes will beat it handily.

Re: TCP HTTP Server written in Assembly

#15
post #12

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?

Well, the JVM might be doing something smarter than your assembler-from-scratch code.

Re: TCP HTTP Server written in Assembly

#16
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:

http://www.neillcorlett.com/etc/mohttpd.asm.txt

And a not so successful thread to go with it: https://news.ycombinator.com/item?id=4714971

Re: TCP HTTP Server written in Assembly

#18
Cool stuff. Really, though, this is still relying on a rather large runtime library: the physical, data-link, and network-layer drivers.

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.

Bonus points if the entire network stack has been flattened using the hand-rolled equivalent of stream-fusion. :)

Re: TCP HTTP Server written in Assembly

#20
post #18

Cool stuff. Really, though, this is still relying on a rather large runtime library: the physical, data-link, and network-layer drivers. 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. Bonus points i…

omfg yes!
Post reply on HN