Show HN: Building a web server in assembly to give my life (a lack of) meaning

· web systems devtools · Source ↗

TLDR

  • ymawky is a syscall-only, no-libc, fork-per-connection static web server written entirely in ARM64 assembly for Apple Silicon macOS.

Key Takeaways

  • Supports GET, PUT, DELETE, OPTIONS, HEAD; PUT is atomic via temp-file-then-rename, supporting uploads up to 1 GiB.
  • Path traversal protection blocks .. sequences; symlinks rejected via O_NOFOLLOW_ANY; paths over PATH_MAX (4096 bytes) are rejected.
  • Slowloris mitigation via 10-second receive and header timeouts; max 256 concurrent fork()ed processes before returning 503.
  • Byte-range requests (full, suffix, open-ended) supported, enabling video scrubbing; MIME detection covers 50+ file extensions.
  • Linux porting requires non-trivial changes: syscall register/convention differences, O_NOFOLLOW_ANY, renameatx_np, signal trampoline, and ELF vs Mach-O relocation syntax.

Hacker News Comment Review

  • The dominant thread is existential: commenters split on whether LLMs make hand-crafted assembly a dying artform or newly accessible – no technical consensus.
  • The author confirmed that writing assembly feels less alien than expected once you build abstractions with procedures and macros; reading it is harder than writing it.
  • Performance benchmarking (requests/second vs nginx/Apache) was raised but left unanswered – no numbers exist yet.

Notable Comments

  • @tgma: Writing large assembly becomes manageable with macros and procedures; reading assembly effectively is the harder skill.
  • @dddddaviddddd: Requests a max-RPS benchmark against full-featured web servers – still open.

Original | Discuss on HN