Is Zig just a trend, or will it become a solidly established language? After all, learning something is an investment of time. With Zig, it doesn't seem to have the same kind of industry pressure as Rust. There's talk in open source circles about AI-related issues, and on Hacker News people say good things about Zig. The allocator concept looks great. But there's also a possibility that it won't become mainstream, like the D language. I personally like D and think its compiler is beautiful, but being linguistically good is different from being industrially adopted. So should I learn Zig, or wait a bit longer?
For now, I have a basic grasp of C#, a little Python, a little C++, and a little TypeScript. I also know Java to some extent, but honestly, what I mostly build is CRUD app assembly. To go deeper, I think I need to dig into a systems language. But I'm not sure whether to invest in Zig or Rust.
If you want to learn systems programming, I can recommend learning C. If you want to learn a programming language which allows systems programming, I guess Rust is not a bad choice. But it might be less helpful if the systems basics are unknown.
I'm suspicious that the user base is people who like to program using pointers in business logic. So, the subset of current C programmers who are willing to switch.
With this in mind: Does anyone here program in Zig, or know someone who does who is not a current C (or C++) programmer?
I program in zig. I am not a current C/C++ programmer (last time I touched C++ was 2003; I can read C ~just fine).
Most recently I have used zig for:
Linux USB driver for a proprietary industrial digital camera that claude hacked the protocol for (I usbpcap'ped it), bound into an embedded Elixir-Nerves biology workstation. Same workstation has a libtoupcap digital camera for a microscope camera also mounted. The proprietary system I am running it on ironically won't work with windows because the proprietary software it shipped with chokes when there are two cameras attached.
I ship zigler, the embed-zig-in-elixir library. I keep finding more and more uses for it!
Unless you’re actively promoting one of the languages for financial gain, you have nothing to lose by delaying commitment to one, both, or either. If any of them have lasting value, they will be as easy to pick up in the future as they are now. Nobody cares about the old Java or .NET versions where both suffered from limited implementations of generics and other things, and nobody is a better programmer for having used them back then compared to picking them up today.
Learning a language is ultimately for the purpose of building something, so doing both is a bit difficult. Personally, I find Zig easier and more approachable than Rust, so I've been reading about it, but I'm worried about what I can actually do with it
It's unsafe and intentionally crashes on windows newlines and tabs. If C adopts defer, I don't think there will be enough of a differentiation to overcome the cynical user hostility.
Encapsulating arguments inside .{} seems superfluous and noisy.
I'm sure this can be rationalized in some way, to either simplify parsing or solve some rare ambiguity, but I just don't see it.
I know this is a minor thing and can be considered as nitpicky, and I expect some friction with syntax when learning a new language, but I just can't stand things I see as gratuitous. Same with the forced use of _ = foo(.{}); to avoid compiling errors...
The situation will improve once they release a stable 1.0 version.
Until then, use mise, nix, docker, or something similar. (You should be doing this anyway for projects in all languages if you care about them building on anyone's machine other than your own.)
Historically, say, 15 years ago before 1.0, Rust too was always shifting about and so you'd find that the software you wrote last month now doesn't even compile and the advice has changed.
Today most people write entirely stable† Rust, and as somebody else mentioned Rust uses Editions to allow it to make any remaining language improvements, but if you were writing mostly unstable Rust you would see a reduced version of the same churn. Last month you could foozle.boozle() and that gets you a Wibble, but then you upgraded and now foozle doesn't have a boozle method, and apparently Wibbles no longer exist at all, everybody says you need to learn about Wumps instead now because those are apparently better or something?
† If you don't use a "nightly" build of Rust or a special opt-in "nightly mode" your Rust compiler only recognises the stable language.
Very brief. I'm not sure what this adds over reading the language documentation (which itself is not great). As it's entirely organized by language features it doesn't really talk about any larger scale design decisions, which is where I think language proficiency is really found.
Best bet is tight integration with a language server and the zig docs as MD locally. You may also pull in the zig source code as canonical reference for best practices.
From there you can derive a set of tools and references that you can build skills on.
Any LLM can scratch together an MCP server, its basically FastAPI + functionality. Your goal, then, is to identify the subset of tools and data required to get 'good' output.
If you want to test your MCP server implementation, grab the source of several popular zig projects, rewind their git history, and have your LLM of choice attempt to address PRs for issues on those repos. Compare LLM solutions with the repo solutions, grade on token spend, LOC produced, variance from Zig best practices, and so on.
For now, I have a basic grasp of C#, a little Python, a little C++, and a little TypeScript. I also know Java to some extent, but honestly, what I mostly build is CRUD app assembly. To go deeper, I think I need to dig into a systems language. But I'm not sure whether to invest in Zig or Rust.
With this in mind: Does anyone here program in Zig, or know someone who does who is not a current C (or C++) programmer?
Most recently I have used zig for:
Linux USB driver for a proprietary industrial digital camera that claude hacked the protocol for (I usbpcap'ped it), bound into an embedded Elixir-Nerves biology workstation. Same workstation has a libtoupcap digital camera for a microscope camera also mounted. The proprietary system I am running it on ironically won't work with windows because the proprietary software it shipped with chokes when there are two cameras attached.
I ship zigler, the embed-zig-in-elixir library. I keep finding more and more uses for it!
> To go deeper, I think I need to dig into a systems language
Most of such code is still written in C.
- Learning Zig by Karl Seguin: https://www.openmymind.net/learning_zig/
- https://zig.guide/
- Free project-based online book Introduction to Zig by Pedro Park: https://pedropark99.github.io/zig-book.
- Ziglings, almost working programs you need to fix: https://codeberg.org/ziglings/exercises
I'm sure this can be rationalized in some way, to either simplify parsing or solve some rare ambiguity, but I just don't see it.
I know this is a minor thing and can be considered as nitpicky, and I expect some friction with syntax when learning a new language, but I just can't stand things I see as gratuitous. Same with the forced use of _ = foo(.{}); to avoid compiling errors...
Until then, use mise, nix, docker, or something similar. (You should be doing this anyway for projects in all languages if you care about them building on anyone's machine other than your own.)
Today most people write entirely stable† Rust, and as somebody else mentioned Rust uses Editions to allow it to make any remaining language improvements, but if you were writing mostly unstable Rust you would see a reduced version of the same churn. Last month you could foozle.boozle() and that gets you a Wibble, but then you upgraded and now foozle doesn't have a boozle method, and apparently Wibbles no longer exist at all, everybody says you need to learn about Wumps instead now because those are apparently better or something?
† If you don't use a "nightly" build of Rust or a special opt-in "nightly mode" your Rust compiler only recognises the stable language.
Currently, doing something with Zig as a target language would spend many more tokens and produce subpar results.
From there you can derive a set of tools and references that you can build skills on.
Any LLM can scratch together an MCP server, its basically FastAPI + functionality. Your goal, then, is to identify the subset of tools and data required to get 'good' output.
If you want to test your MCP server implementation, grab the source of several popular zig projects, rewind their git history, and have your LLM of choice attempt to address PRs for issues on those repos. Compare LLM solutions with the repo solutions, grade on token spend, LOC produced, variance from Zig best practices, and so on.
It's honestly a great read as a human but also I packaged it as a skill and saw coding agent improvement, especially around memory usage.
1. https://tigerbeetle.com/
2. https://tigerstyle.dev/
3. https://github.com/tigerbeetle/tigerbeetle/blob/main/docs/TI...