DevotionGeo

DevotionGeo

When and why would you use Zig instead of Rust and vice versa?

Rust
Zig

Most Liked

Exadra37

Exadra37

Zig - Manual Memory Management:

In order to accomplish this, Zig programmers must manage their own memory, and must handle memory allocation failure.

I am not an expert at all in compiled languages, but from the above line in their docs seems to be one of the main reasons to not use it instead of using Rust, at least in my point of view :wink:

I say this because more then 50% of the bugs in C related stuff comes from memory management, and if I am not in mistake the cause of very dangerous exploits.

dimitarvp

dimitarvp

Zig mostly aims to be a C replacement, whereas Rust aims to displace C++.

However, lately Zig’s author started investing in ergonomics and compatibility more – his article on making the Zig compiler integrate with C compilers and using Zig’s unified CLI commands and switches to interact with those legacy C compilers is excellent – so I am not sure what’s his future direction.

I don’t want to fanboy for Rust but it has a very dedicated and hardcore community and it’s IMO only a matter of time before it eats part of C’s lunch (and thus Zig’s),

Not saying Zig is doomed – I liked its demos a lot and the author is extremely talented.

But between Rust being better and better every month and reaching for more and more areas – parts of the embedded / strongly constrained environments included – I am not sure if Zig won’t remain a niche language whose main selling point would be “I am a better C for microcontrollers”.

Could be wrong though – I am simply sharing what I’ve gathered all over the net and through my own experience. Take it with a bag of salt.

AstonJ

AstonJ

Added the Zig portal :nerd_face:

Popular Backend topics Top

New
bot
So you want to live-reload Rust - fasterthanli.me. Good morning! It is still 2020, and the world is literally on fire , so I guess we c...
New
New
First poster: bot
C++: The Good Parts . Jordan DeLong overviews the past, current and near future “good parts” of C++'s functional side through the colore...
New
kelvinst
I have being some Elixir open-source contributions and side projects. Oh, and I’m doing them on livestreams on my twitch channel, follow ...
New
New
Reinis
I’ve been diving into Bridgetown (a Jekyll successor) and learning about writing a more maintainable CSS.
New
New
mafinar
December is only a few weeks away. I have been detached from programming puzzles for a while now so thought I would give myself some warm...
New
luigiluigiluigi
Hey everyone! :wave: We’re looking for a Back-End Developer Volunteer to help us build something impactful! If you want to gain real-wor...
New

Other popular topics Top

AstonJ
If it’s a mechanical keyboard, which switches do you have? Would you recommend it? Why? What will your next keyboard be? Pics always w...
New
Exadra37
Please tell us what is your preferred monitor setup for programming(not gaming) and why you have chosen it. Does your monitor have eye p...
New
siddhant3030
I’m thinking of buying a monitor that I can rotate to use as a vertical monitor? Also, I want to know if someone is using it for program...
New
PragmaticBookshelf
Design and develop sophisticated 2D games that are as much fun to make as they are to play. From particle effects and pathfinding to soci...
New
AstonJ
Curious to know which languages and frameworks you’re all thinking about learning next :upside_down_face: Perhaps if there’s enough peop...
New
Exadra37
On modern versions of macOS, you simply can’t power on your computer, launch a text editor or eBook reader, and write or read, without a ...
New
Exadra37
I am asking for any distro that only has the bare-bones to be able to get a shell in the server and then just install the packages as we ...
New
mafinar
Crystal recently reached version 1. I had been following it for awhile but never got to really learn it. Most languages I picked up out o...
New
PragmaticBookshelf
A Hero’s Journey with Chris Pine @chrispine Chris Pine, author of Learn to Program, Third Edition, discusses his journey to beco...
New
AstonJ
If you get Can't find emacs in your PATH when trying to install Doom Emacs on your Mac you… just… need to install Emacs first! :lol: bre...
New