215111 Stack

2026-05-10 07:44:46

Exploring ymawky: A Static File Web Server Built Entirely in ARM64 Assembly for macOS

Explore ymawky, a static file web server for macOS written entirely in ARM64 assembly. It supports GET, PUT, DELETE, HEAD, OPTIONS, Range headers, percent decoding, directory listing, and slowloris mitigation.

Introduction

In the world of web development, assembly language is rarely the go‑to choice for building a web server. Yet, a developer has taken on the challenge with ymawky, a static file web server for macOS written entirely in ARM64 assembly. This project demonstrates not only deep technical skill but also a surprisingly robust set of features for such a low‑level implementation.

Exploring ymawky: A Static File Web Server Built Entirely in ARM64 Assembly for macOS
Source: hnrss.org

Overview of ymawky

ymawky is a lightweight web server that serves static files over HTTP. It runs natively on macOS and leverages the ARM64 instruction set, making it a unique exercise in bare‑bones software engineering. Despite being written in assembly, it supports a respectable range of HTTP methods and includes several mechanisms often found in larger, higher‑level servers.

Key Features

The server supports the following HTTP request methods:

  • GET – Standard retrieval of resources.
  • PUT – Upload files to the server.
  • DELETE – Remove existing files.
  • HEAD – Return headers without the body.
  • OPTIONS – Communicate available options.

Additionally, it handles Range: bytes=X-Y headers, which allows clients to request partial content. This is particularly useful for video streaming, where scrubbing to a specific time requires only a portion of the file.

URL and Path Handling

ymawky decodes percent-encoded URLs (e.g., %20 for spaces) and strictly enforces a document root (docroot). This means that attempts to access files outside the designated directory are blocked, preventing directory traversal attacks. For any HTTP error response, the server serves custom error pages instead of generic messages.

Directory Listing

When a directory URL is requested without a trailing index file, ymawky generates an automatic directory listing. This makes it easy to browse the available files without requiring an index.html.

Security and Mitigations

One of the more impressive aspects of ymawky is its attention to security at the assembly level. It includes mitigations against slowloris‑like attacks, where an attacker attempts to hold many connections open by sending headers slowly. By implementing connection‑timeout mechanisms and limiting the number of simultaneous partial requests, the server can resist such denial‑of‑service attempts.

Exploring ymawky: A Static File Web Server Built Entirely in ARM64 Assembly for macOS
Source: hnrss.org

Implementation Details

Writing a web server in assembly requires managing every aspect of the HTTP protocol manually. This includes parsing requests, constructing responses, handling socket I/O, and managing memory. The developer chose ARM64 assembly because it is the native instruction set for modern Macs (Apple Silicon). The result is a minimal yet functional server that strips away the overhead of higher‑level languages like C or Go.

For those interested in the technical journey, the author has provided a more detailed writeup at imtomt.github.io/ymawky/. That article dives into the assembly code structure, the challenges encountered, and the decisions made along the way.

Performance Considerations

While no formal benchmarks are provided, a server written in assembly can potentially offer very low latency and small memory footprint. However, the lack of abstraction means that features like TLS or complex routing are absent. ymawky is best suited for small‑scale or educational use, where understanding every byte matters more than feature completeness.

Conclusion

ymawky is a remarkable project that proves a web server can be built from the ground up in assembly without sacrificing essential functionality. Its support for multiple HTTP methods, range requests, security measures, and directory listing makes it far more than a toy. For developers intrigued by low‑level programming or those who simply want to see how a web server works at the most fundamental level, ymawky is a valuable resource. The dash of humor in the original announcement ("to give my life a lack of meaning") only adds to the charm of this hard‑core engineering effort.