A cycle-accurate Apple II and Apple IIgs emulator written in Zig, usable as both a program and a library.

build the API documentation, and serve it

Most of the explanation of how an Apple II works in this project is in the doc comments, and until now the only way to read it was to open the files. Zig will write it out: `zig build docs` puts it in zig-out/docs. Reading it needs a server, which is the part worth explaining. What Zig emits is not a page but a program — a WebAssembly viewer that fetches the source of everything it shows out of a tar file beside it — and a browser will not fetch anything from a file:// page, so opening the directory gives an empty window and no error. It is the same reason `zig std` runs a server. `zig build docs-serve` builds the documentation and serves it on the loopback interface, with -Ddocs-port to choose the port. The server is the one from zig-datetime rather than a second one written here, and it is better than the one this started as in a way worth recording: it gives each connection a thread. That is not throughput. A browser opens several connections at once and holds some of them open without sending anything, so a server that reads them one at a time waits on a speculative connection and never answers the requests behind it — which is exactly the hang the first attempt here would have had. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FawbWzEu5hoLLZSMCehUGP


Author jcollie.dev
Co-author Claude Opus 5 Date Commit Parent a3671ea5