upvote
Here is where I think Zig shines. When you are a high level programmer that needs to drop down to a low level programming language for performance reasons. The issue with doing that as a high level programmer is that you don't do a lot of low level work frequently.

So unless you work in another domain where you do a lot of low level programming, then every time you drop down you will be out of practice. This favors using a simpler low level language, with low friction for integration. Rust and C++ don't handle being used infrequently, but C with it's simpler standard library and syntax fits this nicely. But it doesn't have things you expect for a modern programming language, and it is also has a lot of dangerous footguns that are easy to forget if you are out of practice

In comes Zig. It's low level, comes with it's own toolchain that makes it pleasant to work with, easy to cross compile, has more safety features built in that C, but is not overly complicated. The code tends to be more verbose, but also more straightforward. So it's a perfect language to pair, when you know you won't be able to do everything in a high level language.

For me that's what seals the deal. I'd argue that Odin has a nicer syntax, but there is a reason that tools like cargo-zigbuild^1 exists. The fact projects not related to Zig are willing to ship Zig toolchains to make lives easier is a testament to how seriously Zig takes this.

1. https://crates.io/crates/cargo-zigbuild

reply
I think if you need to get so close to the bare metal that you'd need unsafe Rust then the equivalent Zig is also too dangerous to use "infrequently". Stuff like writing raw assembly, pointer twiddling, volatile stores or fetches - I would hire somebody with lots more experience to do that properly once if you need it.

On the other hand if safe Rust is an option that's way more handholding than you're getting in Zig. Lots of "Whoops I forgot" mistakes won't even compile in safe Rust because it couldn't see why they're OK and that's required but in Zig now you've written a bug.

reply
For clarity in this dual programming language scenario I'm talking about, I'm writing a user facing app that's mostly a lot of business logic.

It's running slow so I profile it and I see my math function in pure Dart (or whatever language you are writing in) is the hot spot, and pressures the garbage collector too much, so I rewrite the function in a lower level language that doesn't have as much overhead, to speed things up. Then I just call it from the higher level language through the FFI.

The benefit of Zig is the syntax is simple, and the build steps are simple, so it doesn't slow down app development too much

reply
Looking at it from an existing knowledge base and error checking point of view, I feel like C++ smart pointers or Rust is a better option for someone doing a dangerous low level thing rarely. I'm not sure Zig is really all that favorable a choice in your given scenario.
reply
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.
reply
I'm an industrial equipment programmer, so I do see C quite often. Actually, aside from C, it's just that when I first learned programming in college, I started with C. I thought that was only natural, but I guess I didn't explain enough. Inside my own head, C just feels like a given.
reply
In that case, definitely learn Rust, it will expand your thinking about programming and be useful. Zig would just be too similar to C.
reply
What's the difference between a trend and a solid language? I bet many (I mean like millions) people still think Rust is a trend.

> To go deeper, I think I need to dig into a systems language

Most of such code is still written in C.

But honestly, if you just need to squeeze a little bit more performance, you should check the non-GC part of C# first (ArrayPool, Span, stackalloc).

reply
I'd say it's worth learning new languages even purely for the sake and love of learning! That goes to both Rust and Zig, Rust is arguably more intellectually interesting, whereas with Zig you'll probably be writing useable hobby projects much quicker (I decided to tackle learning Zig and reading Crafting Interpreters simultaneously, transliterating the code in the book as I went along).

Zig will be much easier to learn than Rust, but it's worth noting that it's syntactically very unstable between releases (there were some huge changes between 0.15.2 and 0.16 to anything involving IO).

It's really hard to predict what you'll actually use professionally in the future or what's going to be popular in ten years, but some of the greatest value comes from just learning a huge variety of topics.

I'm a firm believer in prioritising enjoyment over utility, and I've always found that utility has flowed backwards from the enjoyment. And even if it doesn't, you've had a good time and found yourself richer for it!

reply
Zig is not only a language. Its whole toolchain and takes freestanding as a target seriously.
reply
Is there a particular domain you'd like to get into? It sounds like you're wanting to build expertise in something other than CRUD app assembly, but my language recommendations might change based on whether that's embedded, game development, distributed systems, system administration, etc.

I don't think in your shoes I'd prioritize learning Zig for any of these domains, though, for a few reasons:

* It's not a pre-req for understanding some existing corpus of important software (which is a big reason for C and C++ in 2026) or the language of choice for some current hot domain (as Python is for AI).

* It's not memory-safe, which (whether via GC or Rust's borrow checker) is increasingly viewed as a critical security attribute.

* It's not stable yet, so I'd expect a certain amount of running to keep in place both in your learning and in avoiding bitrot in anything you write in it.

* From the outside, the community seems strangely hostile as well as elitist.

A few I might suggest instead: Rust (both as a language I personally like and as the most different from the ones you've already touched), Go (which is a good choice for employability), SQL (maybe you already know this one if you're doing CRUD stuff but you didn't list it), bash, and more Python and/or TypeScript.

reply
Lindy effect is very strong in the programming languages world.

Zig is a very interesting and well built language, but it is also niche, unstable and not offering radical improvements over C.

C, as the foundation of all modern kernels and system tools, among many other things, is extremely unlikely to go away soon.

Everything you do in Zig can be done almost in the same way in C or C++.

I would say the real value of Zig is in the standard library that is more modern and arguably better.

reply
> Everything you do in Zig can be done almost in the same way in C or C++.

Can you do this in C?

https://github.com/ityonemo/clr

reply
Linters are not exactly a new idea, and they can be pushed quite far.

I am generally against the idea of language support for meta-programming, even using C macros or C++ templates.

I do a lot of meta-programming/codegen with external tooling.

reply
> Linters are not exactly a new idea, and they can be pushed quite far.

That's not an answer. There's a reason why you can't do it in C, and the reason is "the stdlib is poorly designed". No amount of linting can get you around that.

reply
I agree about the C stdlib being outdated and the worst part of C. This is why I don't use it.

A new modern C standard library would be a very good thing. But I am ok writing my own, tailored for my own needs and style.

reply
deleted
reply
Why do people still view languages as an investment? If you know programming then it's just a different syntax. Focus on learning programming.
reply
You're not wrong at the high level, but learning a particular language to the point of fluency is still an investment if you're interested in being productive while writing it. Sure, once you have the experience, reading most new languages is easy -- but learning the idioms and particular syntactic choices of a new language to that point that you can reach for them without having to constantly search or consult references isn't something that's instant. There's also a mental cost to how many of those languages you can have "ready to go" in your brain at any given time, and for languages that are evolving -- most of them, at this point, honestly, even old languages like C++ -- there's a cost to keeping up with the language as it changes.

All of that is investment, and not all languages pay off that investment.

reply
I’d prefer that you watch this video interview with Andrew Kelley. He is describing that.

https://www.youtube.com/watch?v=iqddnwKF8HQ

Personal thoughts: I think Zig will become more stable once 1.0 tag released. Currently I cant find a fix to my error in net. But the folks on Zig Discord server helping me out.

reply
I predict it will go the way of Ruby but far less adoption or jobs available since Zig community as a whole is anti-AI, which makes it impossible to operate with modern times.
reply
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?

reply
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... write, uh, I just hate make, okay?).

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 (here I use zig for the dlload boundary with elixir). The proprietary system I am running it on ironically won't work with windows anymore 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!

reply
I'm professionally a python programmer with no C/C++ experience, and I do some hobby programming in zig. I tried rust but it seemed complicated and kind of boring. Zig was a lot easier for me to get into. I don't mind that it's obscure and a bit of a moving target, but I have yet to do anything really "serious" with it.
reply
Also people who wants to get into lower level languages but is scared of C's footguns and C++/Rust language size: me.
reply
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.
reply
Hadn't thought of that and I think you're right.

Having been exposed to Java < 5 (before generics) Arrays felt somewhat like JavaScript or PHP3. It's a lot more ergonomic today.

But there are still many remnants (like null refs, despite Option<>) that are easiest understood by tracing back Java's historical roots.

reply
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
reply
IMO, there isn't much space left to fill that Rust couldn't already fill.
reply
Simplicity is one thing Zig excels at (at least from my early observations).
reply
Yup. Rust tries to make it hard to do systems programming poorly. Zig tries to make it easy to do systems programming well. Rust pushes you into certain (good) practices. Zig makes it exceptionally easy to understand what's happening, making good practices the obvious choice.
reply
Haven't yet used Zig in anger, but it looks more like a successor to C (with a bit of Go), whereas Rust is a successor to C++, first and foremost.
reply
How crazy is it to have a language where combining two foundation traits is such a huge footgun that the linter has to warn you (but somehow you can't ban it within the language)
reply
Rust didn't have nearly the industry adoption it does now back in 2020, but it was gaining traction in various parts of the community. If you learned it back then it was either because you love it, or you thought it had staying power.

I think Zig does, specifically because of its build system and it's C interopt story. Plus Zig has the added advantage that learning it teaches you about how the computer works, how memory gets laid out, etc. So even if it never gets wide adoption the skills are highly transferable.

reply
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.

Just because people don't like this doesn't mean it's not true.

reply
> C adopts defer

C will almost certainly adopt defer in the next revision standard. C++ (via RAII + scoped classes) already effectively has defer.

But the fact that it's unsafe means it's effectively unadoptable, no reason not to use C inplace of it.

reply
I feel that Zig will stay a niche language. In this world, there is no reason for corporations to use anything but Rust for this kind of code. And without the corporate push, it will probably still exist for a long time, but the D trajectory is what I predict. I really like the language and I hope it gets more popular, but it seems unlikely to me.
reply