A Modern Web App in C(prophitt.me)
692 points by prophittcorey 1 day ago | 310 comments
tl;dr: A developer shipped a commercial web app (marketyour.games) using the BCHS stack: OpenBSD, C, httpd, and SQLite, served via CGI with every request spawning a fresh process. The result is a single statically-linked binary with only three dependencies (libcurl, libsodium, libcjson), no framework, no templating language, and HTML/CSS written directly in C. The author argues CGI's 2000s-era drawbacks no longer apply given modern fork performance, and praises the stack for minimal supply chain risk, simple tooling, and clear separation of concerns—though notes you have to roll your own cookie/form parsing utilities.
HN Discussion:
  • ↑Supports the BCHS approach, adding related tools and endorsing the privilege-dropping techniques
  • ↑Shares similar personal experience building web apps in C/CGI successfully
  • ~Go with CGO disabled offers a better single-binary alternative to C CGI
  • ↓Prefers stateful backends over spawning a process per request
  • ↓Questions whether this stack can deliver essential modern features like observability and logging