libsodium is written in C and Assembly, but uses Zig as an alternative to autoconf/make/etc.

Builds are much faster than with make, and it makes it very easy to cross-compile to other platform, includes Windows, Linux with specific glibc versions, and WebAssembly.

In fact, it was the easiest to build Linux binaries for .NET, that have to support glibc back to version 2.17, but on a recent OS, with a recent compiler toolchain.

Can you write about the reasons for much faster builds, as far as you know?

Is it mainly due to the zig's caching of the build artifacts?

I'm not who you are replying to, but it's almost certainly due to autoconf &c. For many libraries on a machine with lots of cores, autoconf can take longer than the build, since autoconf isn't parallelized.

Also, IIRC, many smaller projects using autoconf have copied in a bunch of boilerplate feature tests that they don't need, like "is strncpy available" "is snprintf available" "does realloc NULL work". As you mention, each one of these tests generates and compiles a minimal C file, and not in parallel.

(And each test generates/defines a HAVE_SNPRINTF etc macro that your code can use to adapt based on available features. But if the project isn't as big as curl or git, it probably doesn't really adapt to all possible old and obscure systems anyway, so there's no point to 100s of such tests.)

Thanks, both are good general tips, but in this specific case

https://github.com/jedisct1/libsodium

I would guess that the author of the library has full control both over optimal parallelization of a build and minimal autoconf, but he can still observe a huge speedup, so I'd still like to read his answer.