by simonw · 1y ago · 0 comments
pip install ziglang
Which means you don't even have to install it separately to try it out via uvx. If you have uv installed already try this: cd /tmp
echo '#include <stdio.h>
int main() {
printf("Hello, World!");
return 0;
}' > hello.c
uvx --from ziglang python-zig cc /tmp/hello.c
./a.outYou could go further like in this case, and use wheels + PyPi for something unrelated to Python.
Or I should say it was useful as a distribution method, because most people had Python already available. Since most distros now don't allow you to install stuff outside a venv you need uv to install things (via `uv tool install`) and we're not yet at the point where most people already have uv installed.
I know some of it has already happened with rust, but perhaps there’s a broader reckoning that needs to occur here wrt standards around how language specific build and packaging systems handle cross language projects… which could well point to phasing those in favour of nix or pixi, which are designed from the getgo to support this use case.
This is what I've started doing for every library I use. I go to their Github, download their docs, and drop the whole thing into my project. Then whenever the AI gets confused, I say "consult docs/somelib/"
During the last year I have been observing how MCP, tools and agents, have reduced the amount of language specific code we used to write.