Amazing how much, and the type of, spam I get on here :(

Wanted to dogfood pg.zig, I wrote a a couple crawlers (in Go) and exposes the data behind an API using http.zig and pg.zig:

https://www.goblgobl.com/nintendo and https://www.goblgobl.com/lobsters

> cat ~/.psqlrc
\set QUIET
\set HISTFILE          ~/.cache/psql/:DBNAME
\set HISTSIZE          2000
\set HISTCONTROL       ignoredups
\set COMP_KEYWORD_CASE lower
\pset linestyle        unicode
\pset null             'NULL'
\timing                on
\set PROMPT1           '%n@%m %/$ '
\set PROMPT2           ''

Coming to the realization that I don't use assert enough in my code.

Ran into issues using std.Thread.Pool. Over 70% of cycles were spent allocating and freeing the closure. It might be a poor choice if you need thousands of small jobs queued per second. Still investigating though.

Another week, another Zig library. This time a library for generating Prometheus metrics:

https://github.com/karlseguin/metrics.zig

I can't believe tech bloggers lock their content on medium.com.

aolium.com
Changes to http.zig

Working on making http.zig nonblocking. The epoll/kqueue stuff is easy (though, certainly not flawless), but the amount of change I've had to do to the rest of the code is bothersome and almost certainly full of bugs. I now feel strongly that every modern language/stdlib needs a cohesive concurrency story baked in. Goroutines, Erlang processes, stackless coroutines...anything, but something, please!

A native PostgreSQL for Zig. Pretty sure it's the only native client, all others wrap libpq. I'm told it's being used in a production environment:

https://github.com/karlseguin/pg.zig

I've been saying this for a long time: "Stop deploying web application firewalls" - https://www.macchaffee.com/blog/2023/wafs/

Modern cybersecurity is, at best, about compliance, not security. At worse, it's all theater.

Zig's test runner has some frustrations, but there are hooks for writing a custom one. It has its own limitations, but I've been using this:

https://gist.github.com/karlseguin/c6bea5b35e4e8d26af6f81c22cb5d76b

New blog post: Fast Path to Burnout - Delaying Deploys

https://www.openmymind.net/Fast-Path-To-Burnout-Not-Deploying/

There is now a Chinese translation of Learning Zig:

https://zigcc.github.io/learning-zig/index.html