2026-05-14
Subreddit: r/lowlevel
Discussion: View on Reddit (67 points, 11 comments)
Most of us reach for a web framework, or at the very least a systems language like Go or Rust, when we need an HTTP server. This project — ymawky — throws all of that out the window and implements a working web server entirely in ARM64 assembly, targeting Apple Silicon Macs running macOS. No libc, no runtime, no helper libraries — just raw instructions talking directly to the Darwin kernel via syscalls.
What makes this educational rather than a stunt is the layering of concepts you're forced to confront when you strip away every abstraction:
socket, bind, listen, accept, and read/write as raw register-loaded syscalls, with sockaddr_in structures built by hand in memory with the correct endianness for the port.printf or string libraries, parsing the request line and assembling a response means writing your own byte-by-byte scanners and integer-to-ASCII routines.x0–x7, the syscall number in x16, svc #0x80 to trap — these conventions become muscle memory after a few hundred lines.Why is this interesting beyond the novelty? Because it demystifies what a "server" actually is. There's no magic: a socket is a file descriptor, an HTTP response is a sequence of bytes you wrote into a buffer, and the kernel is just a function you call with a particular instruction. Reading this code is one of the fastest ways to internalize that the towering software stacks we use every day all bottom out in a handful of syscalls and some careful pointer arithmetic.
It's also a useful counterpoint to the assumption that assembly is only for kernels, codecs, or cryptography. Networking code is a perfectly reasonable target — it's mostly moving bytes and making syscalls, both of which assembly does naturally. The performance is unlikely to beat a well-tuned C server, but the clarity of seeing exactly which instructions run per request is something no higher-level language gives you.
accept() and the bytes on the wire.
