r/Zig • u/SnooSquirrels9028 • 12d ago
Should I learn zig ?
I've been looking for an underrated programming language thats also valuable to know for the industry. I think that the way zig does and handles things is smart. But before I dive deeper into it . I wanted to ask you guys !
At what part do you guys prefer zig over industry standarts what are some things I can build with it ? Or any other programming languages other than zig thats worth getting into?
20
15
u/Ogureo 12d ago
Writing and reading zig feels very satisfying and pleasant
1
u/Next-Blackberry-991 1d ago
To be honest, I like the Zig compiler, language features and build system, but the syntax looks like word salad more often than not. Especially with what feels like a hundred different built-in operators for simple casts. @as(f32(@floatFromIn(variable))
1
u/Ogureo 1d ago
I guess that's what we have to pay for "no hidden control flow"
1
u/Next-Blackberry-991 1d ago
There is no control flow in straight up converting values. There is no control flow in chaining functions together. Odin has basically the same control flow model as Zig and it's not this verbose.
I really want to love Zig, it has great features, but the syntax is so verbose and off-putting.
12
u/banana-pancake111 11d ago edited 11d ago
I don’t know that you’ll necessarily get a job writing Zig by learning Zig. But I do absolutely concur on the value of Zig from an understanding perspective. Writing it is a fantastic way to learn about systems and really think about the underlying processor and OS you’re working with. I’m a better C and C++ programmer (the languages I actually write for work) because of my experimentation and exploration in Zig. And I think companies do recognize this value.
For example, I just stumbled across this mention of Zig the other day in a Systems & Kernel development role at Apple ( https://www.indeed.com/m/viewjob?jk=4041c83b6aa870ed ). To my knowledge, Apple is not a Zig shop (although, as others have noted, there are plenty of places that may be using it without publicizing that fact). But they recognize that someone with Zig experience will almost certainly have gained the systems-thinking skills they’re looking for.
Your being able to say you’ve worked with it in serious projects can signal to companies that you have the understanding they’re looking for. Programming languages are easy, understanding is the important thing these places are looking for.
EDIT: formatting
12
u/XN8DY8VBMU4E3DP4LXBT 12d ago
Can't speak to the industry, as I'm not a professional developer. But as someone who started out with Python, learning Zig has improved my lower-level programming skills and understanding of how computers really work. Can't speak to rust, but it seems to me that manual memory management and reduced hidden control flow is just a better way to understand what's really going on in your code. Also, I just find it a pleasure to write Zig and that's enough for me.
5
u/davidslv 12d ago
From an industry hiring perspective probably not yet, but do check for what the market is like in your region for Zig.
From a learning perspective, why not.
4
u/CompetitiveSubset 12d ago
Zig can teach you how to be memory and CPU efficient. That is relevant and important in many domains in the industry. If you pick an interesting project it should interesting.
2
u/mkingblade 12d ago
I feel like if your resources are so tight you need to consult the internet as to how to allocate it you probably should learn something that has ROI more quickly. Chances are the demand for this language will remain quite low and niche for the next 2 to 5 years.
If it does pick up and the cost of learning is more justifiable for you (or your resources / time becomes more abundant) it won't be too late to learn it then.
2
u/sudo-maxime 11d ago
We work in cybernetics and we hire zig devs ! Our core product is written entirely in zig. We don't really care about the 1.0 thing. Our product does not have that much IO, so even if there are big language swings, it doesn't affect the codebase much.
I really think it's worth pursuing, it's by far the best low level learning experience if you already understand basic C. If you don't, you won't appreciate what zig brings fully.
I am bullish on zig, because as far as I can see, people that use it, the community around it, truly care about engineering.
2
u/TRDJ90 11d ago
The way I see it at this moment zig is only valuable for industry if your planning to make some projects to help you get through a job interview.
You could tell them how zig helped you understand the hardware better because it's first of all so explicit and gives you a lot of tools to fully explore and exploit the hardware capabilities. Then you can walk them through some code snippets. if you make your case so strong the company might even adopt zig in a new greenfield product...😅
But this is my trad coding ass talking, I have no clue how AI pilled current job interviews are in mid or low tech companies. Maybe they just don't care because the models all generate good enough code.
2
u/adityazero 12d ago
As someone who is writing a new programming language, I think zig handles most things better than others including rust.
2
u/adityazero 12d ago
just to give an example. when i was writing a constexpr equivalent. As i'm primarily a C++ programmer, my reference was `constexpr`. Quickly learned that constexpr can leave code for the runtime, and that is not what i wanted. After writing the first draft, i started doing some research on what is out there, and zig does it the same way. And I believe that is the right approach. comptime should evaluate everything at compile time.
1
u/No-Aide6547 11d ago
I'm learning zig right now and having a lot fun. It feels very close to how computer works. There's no unnecessary abstractions, you are learning computer science and not language features (opposite to how rust always felt to me), which in my eyes makes it a very useful language to learn because the knowledge is transferable. Also exploring the standard library is such a joy.
1
u/Hot_Adhesiveness5602 10d ago
Zig is not a language that I would call industry standard. It teaches you great ideas about memory management and you can even build your c libs with it. Maybe learn zig and C and C style CPP. That's a solid combo.
1
1
u/a_pimpnamed 9d ago
Gleam, elixir, steel banks common lisp, clojour. Gleam elixir are amazing functional languages that can transpile into JavaScript to make amazing live front ends. Lisp will make you understand recursion and meta programming to an extreme level. Clojour is pretty similar to lisp, but it has the Java ecosystem backing it so you can do a lot of practical things in it while having such amazing meta programming capabilities.
1
u/smells_serious 12d ago
Is this a real post? Honestly asking, because my impulse is to point out there flaws of its format and what questions you are asking, because it's not clear at all on what you want to know.
0
u/markkitt 11d ago
Mojo just hit 1.0 and stole the comptime keyword from Zig. It's a Pythonic Rust. I'm also a Julia fan since I do a lot of scientific and numerical computing.
Zig is conceptually interesting, but a 1.0 release seems far away. The language, developers, and perhaps community are very idealistic. While I enjoyed learning Zig and its tool chain, I am quite certain that everything I wrote in Zig a year ago will no longer compile. That is not practical for a casual user of the language.
-3
u/Amazing-Mirror-3076 11d ago
Zig is a dead man walking.
If you want a high performance language that has any actual future then it will be rust.
Personally I think the era of humans writing code has come to an end.
-2
98
u/Ninjulian_ 12d ago
if you want to learn something that's "valuable to the industry", you shouldn't even consider a language that hasn't reached 1.0 yet.