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
xyst1 reply#
Need a straight binary port now
imtomt#
Why stop there? Next, I'm prying open a CPU and poking the transistors with a 9V battery and paperclips to make it execute what I want. Slower, but you get so much control.
shevy-java1 reply#
If it is written in assembly, why is it for MacOS only?
DavidPiper1 reply#
Assembly for the correct architecture is only one part of getting an executable running on a machine.

- Dynamic libraries (e.g. for calling into the kernel, but also user space dynamic libraries) are OS-specific (.so for Linux, .dylib for macOS, .dll for Windows)
- Executable format is OS-specific (ELF for Linux, Mach-O for macOS, PE for Windows)
- Dynamic loading and linkage of both the above are also therefore OS-specific

gsliepen#
And even if you avoid external libraries, you still need to interact with the kernel to do I/O, and that involves system calls that are also non-portable.
camel_gopher#
The hero we needed
arrty88#
Love this so much.

Load more comments