A Tiny HTTP Server in Yar
Yar can now serve HTTP. Not a framework, not a router, not a production web stack. Just a small stdlib package that wraps TCP, parses one request, calls a handler, writes a response, and closes the connection.
Parsers, type checkers, code generators, garbage collectors, and the tradeoffs behind language design. The work behind the tools we think with.
Yar can now serve HTTP. Not a framework, not a router, not a production web stack. Just a small stdlib package that wraps TCP, parses one request, calls a handler, writes a response, and closes the connection.
Most languages add tooling years after the compiler. I built the Yar IntelliJ plugin while the compiler was still changing, and that changed the language design.
Implementing a garbage collector for the Yar compiler meant conservative stack scanning, mark-and-sweep, setjmp for registers, heap growth targets, and one ugly thread-safety constraint.
Yar needed imports across project boundaries, so I built a small package manager: Git dependencies, alias-based imports, content-addressed caching, transitive resolution, lockfiles, and no registry.