I’ve got a project at work with the following key development dependencies:
- linux environment (
wsl (ubuntu)orlinux (ubuntu)) uv(for python)dockeransible(viauv)- < 10 other python packages (
ruff,ty, etc)
So I’ve got a shell script (bootstrap.sh) that installs uv and docker on developer machines, then I’ve got some top-level shell-ish script implemented in python called work.py.
Developers call various functions in the script:
uv run work.py deploy somethingis used by CI for deployment (ansibledependency provided by uv)uv run work.py testruns on developer machines and CI (callspytest)uv run work.py format(just shells toruff)
The target environments are low-tier linux with docker installed (< 8 GB ram, < 4 CPUs).
In this system, uv is my build system (caching my dependencies), but work.py is not a build system, its just something more readable to me than bash. Its only about 1000 lines and can deploy to 10 different environments, etc.
So right now its a single-language project, everything works and the development experience is quite pleasant. Onboarding new developers is just bootstrap.sh, and uv keeps everything else aligned (except docker version), but we have hit some performance bottlenecks that can really only be solved with a compiled language in some small key areas. My team’s highest proficiency is python, by far, and I’m considering integrating Zig for the truly performance critical subsystems.
Heavy on my mind is the following talk from @matklad https://www.youtube.com/watch?v=jVC4DP-8xLM
The talk tells me to stick to the tools I have:
- uv and docker
but that conflicts with the performance limitations I have extensively fought with python profilers etc. After a while of fighting the profilers, I end of writing some python code that looks horible and is just hard to understand and maintain (batching updates to dictionaries, little caching tricks, reducing function call overhead etc…).
My question is if and how I should integrate Zig?
My first project would wholly replace an existing python microservice with zig, reducing it from a 1 GB docker image to maybe 20 MB and reducing its dependencies to only Zig and a well-maintained c library.
- Use zig as my build system (shelling to system installed
uv,docker)? - keep my existing fairly simple build script, add the zig python package, and write python modules in zig?
- Don’t integrate zig at all, and just buy bigger machines (lots of room here to upgrade the targets)?
Completely off the table is using bazel. Its just too hard to understand and teach to others (even for me who is comfortable using it).