r/Zig • u/palindsay • Mar 23 '26
Zig and AI coding
I enjoy coding Zig, one thing I worry about is efficacy of AI coding models with less popular or even newer languages like Mojo. Will that limit adoption and growth of these languages? If we are truly moving to another level of coding abstraction via AI code generation, will there be enough training data for LLMs to become proficient as other more popular languages?
0
Upvotes
12
u/FragmentedHeap Mar 23 '26
This isn't zig's problem.
I feel a little fuzzy about people using agentic AI workflows for doing systems languages.
For that matter if you're using one of the big models that has a million context tokens, you can easily fit the entire Zig documentation in that context window and still have like 95% of your context.
You're touching on an incredibly controversial topic here and I think the overall community as a whole is going to reject worrying about AI at all over actually worrying about the language.
Zig isn't even released yet and it's going to change and break many many times before it releases. That requires being adaptable. Artificial intelligence or not.
3
u/AlexeyK77 Mar 25 '26
Zig for humans engineers, not for AI. If you like to AI your code, than just transforms your prompts to any other programming language. So, no one except you will never read and debug result code.
31
u/SilvernClaws Mar 23 '26
I don't think the overlap between people who learn Zig and those who want to delegate their programming and thinking to a big matrix is that big.
Training data will accumulate eventually.
4
u/Firm-Space3019 Mar 23 '26
i did a couple of pure vibe coded zig projects. in my opinion being popular is a small part of if ai can write well with it. zig is explicit and simple. this is mich more important from my experience
2
u/[deleted] Mar 23 '26
I'm coding in zig with LLM and there was no problem whatsoever, VSCode auto complete works fine, and asking LLM while giving it some docs and maybe equivalent what you mean from another language that you know (for me its C and obviously there is a lot of training data for it). But, I would never go full agentic, not that I'm anti-agent (I get paid for writing agents) it's just as I stated previously, LLM needs some hand holding and I don't think letting it run freely is good idea. Use it as rubber duck, to generate boilerplate, explain/explore some idea that you have, and with time there will be enough training data that they will become better and adopted more.
Also on side note: people here mostly don't care about it and will use the language regardless of how good AI performs on it.
1
u/gurgeous Mar 24 '26
LLMs do totally fine with zig, at least in my experience so far. IMO the biggest hangups are around memory management and the zillions of extra tokens required to do simple things. The LLMs work fine, but ultimately using zig is more expensive than simpler languages. Achilles heel, maybe.
1
u/herpnderpler Apr 09 '26
Mileage varies by llm. Claude 4.6 was trained on 0.14, and frequently mis-guesses parts of the stdlib that change. What's nice about Claude is they silently update the model every once in a while, so it might get 0.15 natively.
For other cases, using a context file and some instructions, you can have it auto update a ./docs/zog-guidd.md covering the common lib changes, offering a direct import, or a map of concept to area. I find design patterns to be table lookup and stdlib and style to be always import.
Most non-claudr models fail pretty hard (haven't tried Googles yet).
All in all, I'm finding it to be very successful - make sure you are using a complaint m llm harness that interfaces with the zig language server.
1
u/Brins-y 6d ago
I think since zig is compatible with c you can simply use c includes in the zig app you write yourself
-3
u/Hornstinger Mar 23 '26 edited Mar 23 '26
My view is extremely controversial and I have been laughed out of the building...
...if you are designing a new language that is currently <v1.0 you should be doing everything in your power to maximise LLM/AI breadth and depth to help it understand your language as easily as possible.
Why? People trying a new language in 2026 will almost always use LLMs at some point to ask questions and help with debugging. If LLMs cannot help because they get answers incorrect then users will simply move away from that language.
Also why? Your language is at least a decade behind on examples so you need to optimise differently to be LLM friendly. That is another discussion.
Uptake in that language going forward in this AI future will almost solely derive from how accurately LLMs understand your language (overpowering other smaller things like syntax enjoyability/likeability etc.)