Lurker News
This is ymawky, a static file web server for MacOS written entirely in ARM64 assembly. It supports GET, PUT, DELETE, HEAD, and OPTIONS requests, and supports Range: bytes=X-Y headers (which allows scrubbing for video streaming). It decodes percent-encoded URLs, strictly enforces docroot, serves custom error pages for any HTTP error response, supports directory listing, and has (some) mitigations against slowloris-like attacks.

I’ve also written a more detailed writeup here: https://imtomt.github.io/ymawky/

Comments (227) 57 threads

Earlier comments
chrisweekly2 replies#
That fake O'Reilly book cover is pure gold.
imtomt1 reply#
That book is exactly what inspired me to make this in the first place, haha. The subtitle of the book gave me the acronym I named it.
orthogonal_cube#
I frequently reference this exact meme to people whenever someone complains about complicated or difficult-to-write code. Now that’s you’ve made this project I suppose we have zero room to complain anymore!
____tom____#
Fauxreilly!
dddddaviddddd2 replies#
Even though it's a meaningless comparison, I'd be interested to see how performance compares (max requests per second?) for this compared to fully-featured web servers.
imtomt#
Honestly haven't benchmarked it, but I would imagine ymawky would be considerably slower than most fully-featured web servers. ymawky uses fork-per-connection, which is fundamentally slower than what production servers like nginx or Apache use. nginx uses event-driven IO (kqueue/epoll), which can handle thousands of concurrent connections without the overhead of forking the process on each request. Apache uses pools of threads which handle multiple connections without needing to be spawned per-request. A head-to-head against any other web server would mostly measure "fork-per-connection vs event loop/thread pools", which assembly has nothing to do with.

In a comparison between a similar fork-per-connection server written in C and this, I would imagine the throughput would be about the same, because the bottleneck in this model is fork() itself rather than the actual code. It probably matters more for binary size and startup time than requests/sec. Would be fun to actually benchmark, though.

arrty88#
Should i ask my Claude to benchmark it against nginx or will you ask yours
stbev3 replies#
I am attempting to write a software renderer in WebAssembly because, for some reason, I feel the need to go against the direction this vibe coded world is going, and I want to feel challenged again. I don't know if I will ever finish it, it is crazy, and by no means useful. But gosh it feels so good.

Congratulations to the OP for the accomplishment.

PacificSpecific1 reply#
Please post your progress! That sounds cool as hell
stbev#
Thank you! I will keep working on it and post something here
qingcharles2 replies#
As in 3D software renderer? I cut my teeth on those throughout my teens and the start of my professional career, in x86 and C.

I wanted to see how an LLM would do writing one in pure 8088 assembler for CGA and it one-shot a nice demo (I fed it the vectors for the Elite ship in the prompt):
https://imgur.com/a/Dy5rUku

stbev2 replies#
Yes, exactly, a 3D software renderer. But the goal is to do (almost) everything from scratch and by hand. No LLMs, no std library, no compilers. Just a few imported math functions (such as sin and cos). Not the same as bare metal programming but close
MagicMoonlight1 reply#
Why would you screw yourself like that when it's already a huge project?

Continue this thread — 1 reply

bananaboy#
Awesome, do it! I love this kind of thing and do it regularly, mostly as part of the demoscene. I've written a bunch of demos for MS-DOS/VGA/Pentium 100 era hardware. All my own tools, almost all my own code (just using some standard library functions and someone else's mod player although that's on my list of things to write myself). All in mostly C with smatterings of assembly for speed (triangle rasteriser inner loops etc).

I also wrote a demo for 386/CGA hardware last year and I plan on porting that one to an 8086 as I think it is simple enough that it should be able to run on one. I've done a demo for the Sega Master System and I'm about to start a project for the Game Gear.
I also made a bare metal demo for the Leapster Explorer (an ARM-based kids toy).
I don't use AI for any of this because for me the interesting part is the journey as well as the final result. I want to learn how things work, and I enjoy writing the code.

bananaboy1 reply#
How well does that run on real hardware (or PCem/86box)?
qingcharles1 reply#
I'm using DOSbox to test it right now, but it works perfectly under the emu. I'd love to try it on a real 5160 or similar.

Continue this thread — 1 reply

polaris64#
I did exactly the same and it was so much fun. It wasn't about bringing anything novel to the table, it was just a fun challenge for myself. I finished and now I'm writing a game using it, although now the challenge has gone I am not making much progress on that. But never mind, I had fun! I wouldn't have had that fun or satisfaction if I had vibe coded it instead.
behaviors1 reply#
Well done. Been working on a similar smaller project for RISC-V. This is excellent
imtomt1 reply#
That's so cool! I would love to see it if you're sharing it anywhere.
behaviors#
It's a HTML browser for Pi Pico2, CLI, meant to support my in-house project running on a mesh of Pico2's. I really wanted to use RISC-V and it needed a webhook that serves a page on PIO wake. We are at the browser is written about 60%. The server is now already handled ;P I found this awesome project someone posted on HN. When I complete my project the browser will be released alongside. You can very likely reproduce it with less than a handful of prompts. One thing I really do believe, ideas are going to be the next open-source. LLM's can make ideas into things.

Load more comments