I was curious how a simple x11 program would compare when using zigx vs libxcb. Zigx is fully in zig and compiles to a static executable whereas libxcb is a dynamic C library. Both api’s are actually fairly similar so it’s an interesting comparison between static vs dynamic linking. I published the sources for both examples and details in a gist.
Approximately how many apps that would take advantage of the shared libs would it take to even the playing field? If all apps were like “hello”, Is it approximately 20? (rough mental estimate from your numbers) … (is that even meaningful?)
That is usually the difference in thinking between a package maintainer and a developer. Do you care about the whole system, or just your program/library.
And a better comparison would be zigx static vs zigx dynamic, as zig still has differences beyond its preferred single compilation unit.
Yeah interesting questions to think about. Another idea is to try implementing the libxcb API with zigx, I might try that at some point.
I don’t know if we would invent shared libraries again if we didn’t already have them though. Or if we did, might look more like the WASM Component Model than a bunch of least-common-denominator ABI conventions.
Not too late ![]()