Why does Zig pay more?

  Рет қаралды 6,123

Kodaps Academy

Kodaps Academy

Ай бұрын

🌐 Get Started with Zig
CodeCrafters: app.codecrafters.io/join?via=...
Exercism: exercism.org
Zig is a systems programming language that's garnering attention for its innovative features and potential to complement classic languages like C. Triggered by Zig's role in powering the Bun JavaScript runtime and its notable position in salary surveys, we delve into what makes Zig an intriguing choice for developers.
👨‍💻 What is Zig?
Zig is a modern programming language designed to interoperate seamlessly with C, offering a refreshing approach to system-level coding challenges. It does not aim to replace C entirely but rather to improve and secure C/C++ codebases gradually.
🔍 Comparing Zig with Rust and C
While C has been the backbone of operating systems and device drivers since the 1970s, Zig introduces robust error and memory management systems to tackle the limitations of C. Unlike Rust, which enforces strict ownership rules to eliminate common bugs, Zig focuses on explicit error handling and flexible memory management, providing safer and clearer code.
🛠️ Key Features of Zig
Error Management: Integrates error handling into the type system, mandating explicit error management.
Memory Management: Enhances safety with type-driven guardrails, reducing the risk of runtime memory errors.
Compilation and Comptime: Simplifies the build process and enhances readability, also supporting cross-compilation effortlessly.
📈 Is Zig Worth Learning?
While Zig offers considerable advantages, especially for current C/C++ developers looking to enhance their code's safety and clarity, it remains a young language. It's evolving, with ongoing changes that might affect early adopters.
💬 Join the Discussion
What are your thoughts on Zig? Are you considering it for your next project? Share your views in the comments below, and let's discuss the future of systems programming!
👀 Stay Tuned
Don't forget to like, subscribe, and hit the notification bell to catch our upcoming video on which programming languages are worth your time this year!
----
Want to go into further depth? Head to kodaps.dev/

Пікірлер: 39
@meka4996
@meka4996 9 күн бұрын
In short, if you have existing C projects, use Zig to fix it. If not, use Rust for new projects.
@mschwanitz
@mschwanitz Ай бұрын
Love your vids! Keep em coming.
@pietraderdetective8953
@pietraderdetective8953 Ай бұрын
any plan making a Zig tutorial series? would be awesome since current Zig references are a bit difficult to find...another plus Zig looks to be the hype of 2024. Major devTubers / devTwitchers are covering it.
@MatthisDayer
@MatthisDayer 4 күн бұрын
read language reference, if you have experience with c, c++, rust or go you thrive, if not you should really learn c first before going to zig
@Leonhart_93
@Leonhart_93 Ай бұрын
I would love to use Zig for bigger stuff IF it was less annoying about the dev experience and normal debugging techniques. A random unused variable or a var that never mutates being considered breaking compiler errors without any way to turn it off feels extremely tedious, when you have no intention of commenting and removing everything like that with every compile.
@metaphoricallyalive8109
@metaphoricallyalive8109 Ай бұрын
Isn't that for better safety? I'd guess rustc makes you do the same?
@Leonhart_93
@Leonhart_93 Ай бұрын
@@metaphoricallyalive8109 What safety? So that I can't comment a function call to debug it because 3 vars get unused and I go to comment them which causes another 2 to get unused? Forcing that for dev builds with no way to turn it off is anti user experience. And I think Rust has them as warnings, not sure.
@testing-nj2ne
@testing-nj2ne Ай бұрын
@@Leonhart_93 I totally agree with you. For someone, just starting out it's highly annoying and soul destroying. But in professional code it's pretty much a "must have". It's a shame we can't have a -professional or -amateur switch on the zig build.
@Leonhart_93
@Leonhart_93 Ай бұрын
@@testing-nj2ne It's perfectly possible. If C allows it and they get optimized by the compiler anyway, then what's the problem? Besides, that's why there are dev builds and release builds. Only that for these new languages there are no dev builds anymore, everything you write has to be no-chill.
@theevilcottonball
@theevilcottonball Ай бұрын
@@metaphoricallyalive8109 Rustc issues a warning. Zig does not have the concept of warning it straight up refuses to compile. An unused variable by itself is not safety critical. It is just annoying to get the error while developing, for production code not having them is the right approach imho.
@Alex.Shalda
@Alex.Shalda Ай бұрын
Thanks for the vid ❤
@KodapsAcademy
@KodapsAcademy Ай бұрын
Glad to be of service :)
@eduardabramovich1216
@eduardabramovich1216 Ай бұрын
what's your opinion of Odin if you have checked it?
@testing-nj2ne
@testing-nj2ne Ай бұрын
A problem with Odin, is that it is "owned" and funded by a company. A company has to extract money for it's shareholders. It might start with a "Don't be evil" motto. But legally they have a fiduciary responsibility to the bottom line. Zig is owned by a non profit. A non profit has to put it's profits back into the mission.
@gabrielkwong1878
@gabrielkwong1878 Ай бұрын
I can see a future with zig especially with embedded programming, tho I wonder if rust will somehow make a really good developer experience tho comptime in rust is... well. Anyway on the other hand Odin seems interesting would recommend checking it out, its competitive in the computer graphics space but I wonder if there is a future with embedded systems programming for Odin.
@Leonhart_93
@Leonhart_93 Ай бұрын
Rust's good developer experience is purely subjective. I can tell quite clearly, it's not popular with those developers that don't like to be told what to do by some layers of abstraction. From my point of view it's either low level control or not, not much in between. That being said Zig also has some annoying stuff built-in, forcing you to do things in specific ways in your own code. Like unused vars being hard errors, it's incredibly disrupting for debugging.
@theevilcottonball
@theevilcottonball Ай бұрын
Well, having tried both C and Zig, I would argue that C is the better language. In C you can do things your way. (Unlike in the video, you do not have to use integers for error handling, you can do it the way you prefer (tagged unions, out parameters, a thread local error log, ...). Also saying that Zig solves UB is just plain wrong, in some respects Zig has more UB (although more consistent) like Zig has undefined behaviour for unsigned integer types, whereas C does not. Both languages offer some tooling to deal with that (releasesafe, UBSAN). The advantage of C is, that it is still the language of native system interfaces, it has a stable ABI so it can act as intermediary between languages and it is standardised. It has many problems, for sure, but they are well known and good C programmers know how to work around them. On the other hand, I think Zig's killer features are comptime, builtin slices, async and null safety. BTW: I do not like the Zig developer experience, it has no ways to configure compiler warnings (it just has errors, and even complains about minor details like whitespace), it's error messages are not that good, it is slow to compile (gcc is fast especially for unity builds, but everyone talks about GO's compilation times). The syntax is a little noisy too. Zig's greatest feature is actually the builtin C compiler, it makes it easy to compile your C code cross-platfrom, it is easy to install and takes up little space (I am looking at you Visual Studio C). some people use Zig as their build system, I have not tried that though, and it does not solve the fragmented landscape of C and C++ build systems.
@staynjohnson4221
@staynjohnson4221 Ай бұрын
how are you highlighting the screen with boxes and arrows ?
@KodapsAcademy
@KodapsAcademy 18 күн бұрын
Hi, I'm using a piece of software called "Presentify" setapp.sjv.io/c/4172596/849350/5114 :)
@staynjohnson4221
@staynjohnson4221 18 күн бұрын
​@@KodapsAcademythanks!
@3bdo3id
@3bdo3id 17 күн бұрын
you should have said I'll zig you in this next video instead of I'll C you in this next video
@KodapsAcademy
@KodapsAcademy 17 күн бұрын
Clearly a missed opportunity :D
@dustee2680
@dustee2680 Ай бұрын
it looks quite intimidating to a lowly c# pleb like myself but it peaks my interest
@KodapsAcademy
@KodapsAcademy Ай бұрын
I'm gad the video intrigued you, I hope it ends up being useful in the long term :)
@mgord9518
@mgord9518 Ай бұрын
You might be surprised. I had only used Go and Python previously, picked up Zig fairly quickly. Once you start understanding manual memory management it gets really easy
@Pismice
@Pismice Ай бұрын
its not true to say the concurency is a native language feature in zig, async/await has been dropped since 0.11 if i remember correctly
@nothke
@nothke 15 күн бұрын
It has been TEMPORARILY removed because there are some big issues to solve. These problems are not impossible to solve but it takes time. But they're definitely planning to add them back. Check the 0.12 change log it's mentioned there.
@Pismice
@Pismice 15 күн бұрын
@@nothke it is not 100% sure that they are going to add it, there is a github discussion I couldnt find where they discuss if they truly want this or not.
@science_trip
@science_trip Ай бұрын
ok. but breaking changes in every sub-version is not a good idea. But of course I prefer it more than Rust
@KodapsAcademy
@KodapsAcademy Ай бұрын
That was (partly) my point in the conclusion :)
@basit005
@basit005 Ай бұрын
I agree but Zig is a much newer language and only like v0.12. I'm sure rust also had breaking changes at that version
@KodapsAcademy
@KodapsAcademy Ай бұрын
@basit005 sure. But the underlying question is : is it stable enough to warrant investing time in at this stage ?
@basit005
@basit005 Ай бұрын
@@KodapsAcademy I really don't know the answer to that. Perhaps we should hold off on making really ambitious software in it right now, but as a counterexample - bun
@UliTroyo
@UliTroyo Ай бұрын
Yeah but the goal is to be finished at 1.0. I love the idea of a finished language.
@arson5304
@arson5304 Ай бұрын
i think your notion about zig's error handling is misinformed, it's meant to be a replacement for exception handling in other languages, not to inherently protect you from memory related issues. rust has this same feature so it's not really contrasting in that sense.
@rsalmei
@rsalmei 18 күн бұрын
Rust is much more complete, Rust doesn't have NULL, and Rust doesn't have exceptions, it is all part of the type system.
@pratikshares
@pratikshares 13 күн бұрын
But, didn't answer the question: Why Zig pays more?
@neshkeev
@neshkeev Ай бұрын
Nothing will replace C in low level programming as long as we go with the Von Neumann architecture although Rust fanboys are trying to convince everyone otherwise
What Makes Rust Different?
12:38
No Boilerplate
Рет қаралды 196 М.
Jai vs Odin systems programming languages (Non-spicy takes!)
20:10
Context Free
Рет қаралды 68 М.
ПООСТЕРЕГИСЬ🙊🙊🙊
00:39
Chapitosiki
Рет қаралды 61 МЛН
Who’s more flexible:💖 or 💚? @milanaroller
00:14
Diana Belitskay
Рет қаралды 19 МЛН
Can you beat this impossible game?
00:13
LOL
Рет қаралды 66 МЛН
Why i think C++ is better than rust
32:48
ThePrimeTime
Рет қаралды 270 М.
MUST KNOW bashrc customizations to boost productivity in Linux
13:38
Async Rust Is A Bad Language | Prime Reacts
28:46
ThePrimeTime
Рет қаралды 86 М.
When Zig Outshines Rust | Prime Reacts
23:31
ThePrimeTime
Рет қаралды 132 М.
Zig in Depth: Build Dependencies
14:50
Dude the Builder
Рет қаралды 1,2 М.
Compiling C to printable x86, to make an executable research paper
25:41
8 Design Patterns | Prime Reacts
22:10
ThePrimeTime
Рет қаралды 383 М.
Zig for Impatient Devs
9:48
Isaac Harris-Holt
Рет қаралды 65 М.
iPhone 15 Unboxing Paper diy
0:57
Cute Fay
Рет қаралды 3 МЛН
Will the battery emit smoke if it rotates rapidly?
0:11
Meaningful Cartoons 183
Рет қаралды 6 МЛН
😱НОУТБУК СОСЕДКИ😱
0:30
OMG DEN
Рет қаралды 3,4 МЛН