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
imtomt1 reply#
Oh wow! Your project was actually really inspiring to me, thank you for making this. I was really impressed reading through it a while back. Is it alright if I add a link to your repo in my README?
jcalvinowens#
How fun! I'm glad it was interesting, please feel free to link to it :)
thatxliner2 replies#
I'm wanting to read this repository as a learning tool, so it'd also be nice to include docs—even AI-generated docs, but obvious I'd prefer docs with your own design notes and decisions—about the architecture of the code.

Really cool project though!

imtomt1 reply#
Thanks, I appreciate it a lot! I tried to comment my code pretty heavily (~3000 lines of code, ~1000 lines of comments all together), since this was a learning project for myself in the first place. Hopefully those will be of some use. But separate in-depth documentation is definitely a good idea, I'll work on adding that. In the meantime I'm always down to answer any questions about it!
thatxliner1 reply#
My first question would be where should I start reading? It seems like you modularized it into multiple assembly files (how does that even work?)
imtomt#
Honestly, read the main file, ymawky.S first. Then I'd read through get.S maybe, checking parse.S on an as-needed basis for parsing-related functions. delete.S or options.S are pretty short, too, so give those a read too.

Modularizing it into multiple files was easier than I expected it to be, you basically have other functions/labels in other files, and mark them as .global at the top. The Makefile compiles each file into their own .o, which you then link all together. You can "b" or "bl" to any label from any other file, as long as it's global and linked together. Same with data in .bss or .data, mark them as .global and they can be accessed from elsewhere.

vasco#
If you'd be happy with that then you can generate them yourself!
toshikatsu-oga#
Love the honesty in the title. I'm 49, learned to code two years ago after 30 years as a carpenter, and "to give my life meaning" hits closer than most career ladders ever did.

Bookmarking this — going to read the source on my Sunday off.

sen1 reply#
This is brilliant, I love it.

The absolute best projects ever posted here are the ones made for no other reason than “just because I wanted to”.

imtomt#
Thank you. My favorite reasons for projects are "just because I wanted to" and "because someone told me I shouldn't", and this one ticks both boxes, haha.

Load more comments