Amazig: Origin Shift maze generation library for Zig

CPU+MEM only stuff

  • constructing requests, parsing replies (client side)
  • parsing requests, constructing replies (server side)
  • buffer managment

I/O (possibly event driven or asynchoronous)

  • sending requests, reading replies (client side)
  • reading requests, sending replies (server side)

Examples of “fat” API functions:

  • FCGI_Accept() from libfcgi - reads request and parses it
  • PQconnectdb from libpq - constructs messages, send messages, reads messages, parses messages. Decomposition, pg connector state machine.
  • a lot more…

Of course, using such fat functions is ok for a simple one-shot program or for a multi-threaded program, but for a single-threaded program with event driven I/O and fine grained concurrency it’s better to have only “CPU+MEM” API in a library and let an application itself control all I/O within chosen strategy.