From the socket up.
c-copper is the C framework serving this page. Around it: Lunar, a typed superset of Lua with its own compiler and LSP; Cobre, the opinionated successor framework; and Axon, the archived first pass at an LLM gateway.
src + controllers
registered
directives
dependencies
src/router.c — thread-safe pattern matching.
Literal routes short-circuit on strcmp. Parameterised routes tokenise both pattern and
path with strtok_r, binding {param} segments onto the request.
First match wins.
// Thread-safe URL pattern matching using strtok_r static int match_pattern(const char* pattern, const char* path, Request* req) { if (!strchr(pattern, '{')) return strcmp(pattern, path) == 0; char pat_copy[256], path_copy[256]; strncat(pat_copy, pattern, sizeof(pat_copy) - 1); strncat(path_copy, path, sizeof(path_copy) - 1); char *save1, *save2; char* p_seg = strtok_r(pat_copy, "/", &save1); char* path_seg = strtok_r(path_copy, "/", &save2); while (p_seg && path_seg) { if (p_seg[0] == '{') { // extract {id} → bind to request param request_set_param(req, param, path_seg); } else if (strcmp(p_seg, path_seg) != 0) { return 0; } p_seg = strtok_r(NULL, "/", &save1); path_seg = strtok_r(NULL, "/", &save2); } return (p_seg == NULL && path_seg == NULL); }
Five stages, each one a file you can read.
Cobre — Razor-pages-inspired web framework in C
.cob source files transpile to .gen.c, then compile to .so and hot-load. Arena allocator with a Str type, goto cleanup error handling, TOML config. The opinionated successor to c-copper.
Lunar — statically-typed superset of Lua
Compiler, LSP, bundler, test framework — all in Go. TypeScript-for-Lua, end to end. Strong types on top of Lua semantics so projects that grew past the comfortable Lua size still have a teaching tool for the next person to read them.
Axon — self-hosted LLM gateway
First pass at an on-premise LLM gateway in C#. Routing, request shaping, prompt template layering. Useful exercise in API surface design and provider abstraction; stays in the archive.