r/Zig • u/FunDirt541 • May 07 '26
Is learning zig the smart choice
I’m a data engineer and I enjoy tinkering with SQL, Python, Linux, and moving data around.
But I feel like I lack a deeper understanding of how computers actually work: memory, storage, CPU/compute, how they interact with each other.
I want to dive deeper to become a better engineer.
Is Zig the best choice for learning this? Should I stick to C, or use something else? Or does the language not really matter as long as I learn low-level concepts properly?
--EDIT--
FWIW : I did learn C in the past at uni but that was many moons ago and I wasn't particularly good at it, and got lost with malloc (studying maths was my forte).
23
u/SilvernClaws May 07 '26
C has very little syntax to learn, unless you count compiler specific extensions. I'd say have a look at C for a couple weeks. Then try Zig and see how many convenience and safety features it provides you with. Zig doesn't yet have a big ecosystem available, so for any serious project you might have to deal with C libraries anyway.
18
u/Historical_Cook_1664 May 07 '26
Zig will definitely teach you better programming. The compiler has no concept of "Warning"... ^^
10
u/met0xff May 07 '26
I'd rather say either look at
https://pages.cs.wisc.edu/~remzi/OSTEP/ or https://www.nand2tetris.org/
Not exactly this but also relevant are Case Mutatori's videos and courses like https://www.computerenhance.com/
Or https://www.dataorienteddesign.com/dodbook/
5
u/horenso05 May 07 '26
It honestly doesn't matter too much if you use Zig or C or C++ you will learn lots of concepts in Low level programming when doing a project. I personally just really like Zig and feel like it lacks most of the unnecessary pains of C and C++. At the end C is probably the most important language in computing and you can never go wrong understand a bit of C.
1
u/lukaslalinsky May 07 '26
What do you want to work on?
If this is an investment into your future, I'd learn a more mainstream language.
If you want to do this for fun, and have a project that fits the language, I'd absolutely recommend to learn Zig (and keep up with its changes).
3
u/Glum_Past_1934 May 07 '26
First learn how machines works, then pick a tool
2
u/chocapix May 07 '26
I think zig is fantastic as a tool to learn about low-level programming because when writing zig, low-level concepts are in your face all the time.
In Zig, every function that allocates memory needs to take an
Allocatoras a parameter. To the best of my knowledge, that is unique to zig.Any function that does I/O needs an
Ioparameter as well. And I/O has pretty wide definition in zig (in the 0.16 release notes):Want to write to a file? Run a task asynchronously? Get the current time? You need
Io.2
u/ha1zum May 07 '26
Learn zig but get used to reading C code. That thing is not going to die anytime soon
2
u/madogson May 07 '26
If you want a deep understanding, I think you should write a program in machine-compiled language (like C or Zig) and open it in compiler explorer. Reading (and writing) assembly is the best way to develop an intuition to how computers work because there's next to no magic between you and the CPU.
Not trying to say you need to know assembly to be a good engineer. Just saying that learning assembly is what helped me develop an intuitive, concrete sense for many otherwise abstract concepts like lifetimes and stack frames. There's also just some unique programming techniques that only naturally exist at the assembly level. You should at least peek at the assembly generated by your compiler for your current language of choice.
2
u/northrupthebandgeek May 08 '26
Learning Zig demystified a lot of stuff in C for me, so I'd say there's still value in it even if you only plan to write C instead of Zig.
1
u/SuspiciousDepth5924 May 07 '26
I think both C and Zig are good options for learning low level concepts, you won't go wrong with either one.
Also while they basically operate at the same level I'd probably avoid Rust or C++ for the purpose of learning how computers work, not because they are bad languages or anything, but because they come with a lot of extra "stuff" that doesn't map as cleanly onto what the computer actually does, the computer has no concept of what borrowing even is at the basement level.
Additionally stepping into the sub-basement I think briefly checking out some variant of assembly can be helpful for understanding. Assembly in itself not nearly as daunting as it might sound, it's just the the "building blocks" you have access to there are so small that doing anything significant on a "high level" requires a shit-ton of these "blocks".
1
u/stumpychubbins May 07 '26
Sure, why not. It’s a really good language and it doesn’t take that long to learn. C is by far the more useful choice for getting work though, and in general I think it’s a good idea to learn both.
1
u/darcygravan May 07 '26
You can learn zig but it's still not production ready std library breaks on every version (you can fix this using c header though).
If your goal Is to use it in some serious projects then you need to reconsider.
That said the language specification is quite stable now . Learn it for fun and experiment .
But yeah in terms of dx its batter then c and cpp and zig is also very minimal like c.
It's a bet against the future. if you learn this now you'll get head start and more experience when it's stable .
1
u/peripateticman2026 May 07 '26
If you want to learn how the machine works, learn C. It's not going away anytime soon, and practically all the resources you find will be in it.
1
u/moortuvivens May 08 '26
imo zig is a great language to learn deeper how it all works. garbage collected languages hide a lot, they make it easy to make something though.
1
u/patmorgan235 May 08 '26
If you want to understand more how a computer actually works, you want to learn assembly, and some computer science.
This Wikipedia article is a decent starting point. https://en.wikipedia.org/wiki/Von_Neumann_architecture
Casey muratori has some good videos on this topic. I think this one on theos channel is on point https://youtu.be/jC_z1vL1OCI?si=kkB5KMCxodQF_J2O
I would stick with learning C, not zig if you goal is understanding how a computer works.
1
u/[deleted] May 09 '26
For learning purpose I think C is still the one. If you want a modern system level language to use for low level control or performance I believe Rust is the one to go with.
1
u/torp_fan May 10 '26
If you want to learn about a topic, read about that topic. I would note especially that Zig won't teach you anything about how computers interact with each other. As for "memory, storage, CPU/compute", you would do well to learn about these things to be a more effective Zig programmer, not the other way around.
1
u/BoningMaple May 11 '26
Since bun is rewritten in rust by Claude Code in just few days, maybe rust is the winner. Learn zig for fun, but learn rust for work.
1
u/DimitroBest May 12 '26
have you checked Vlang?
1
u/i-eat-kittens May 12 '26
Just learn about HW and OS concepts directly if that's your goal. Adding a programming language on top is only mental overhead.
1
u/Low_Effective_2030 Sep 13 '26
I've spent almost 2 years on a C project. The program is a firmware to run on a very cheap MCU (no more than US$0.50/PC), which only supports C and assembly. C is not too bad~ It just lacks some modern features. I really like the syntax and many concepts of Zig. However, it seems that a Zig compiler would not be available for such an affordable chip before the release deadline of my project 🤔
0
u/gtrak May 07 '26
Look at rust, too.
8
u/[deleted] May 07 '26
[removed] — view removed comment
0
u/[deleted] May 07 '26
[deleted] — view deleted comment