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

PragmaticBookshelf
Stop developing web apps with yesterday’s tools. Today, developers are increasingly adopting Clojure as a web-development platform. See f...
New
AstonJ
Currently a hot topic in the BEAM world, let’s start a thread for it (as suggested by @crowdhailer here) :smiley: What are your current...
New
New
AstonJ
Just done a fresh install of macOS Big Sur and on installing Erlang I am getting: asdf install erlang 23.1.2 Configure failed. checking ...
New
ariandanim
Hello, i am facing difficult using webpack when to install within phoenix framework 1.5.7 because the webpack is still version 4.x.x inf...
New
CinderellaMan
Create a cryptocurrency trading bot in Elixir (YouTube videos, ebook pay what you want) <span class="hashtag-icon-placeholder"></span>eli...
New
AstonJ
More cool tech inspired by <span class="hashtag-icon-placeholder"></span>erlang :nerd_face: By combining the fault-tolerance and massiv...
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
OvermindDL1
Woooooooo! This is such a huge release for it, and 2 years incoming! In short, the library is now using an updated hyper backend (not j...
New
PragmaticBookshelf
Leverage Elixir and the Nx ecosystem to build intelligent applications that solve real-world problems in computer vision, natural languag...
New

Other popular topics Top

Devtalk
Hello Devtalk World! Please let us know a little about who you are and where you’re from :nerd_face:
New
DevotionGeo
I know that these benchmarks might not be the exact picture of real-world scenario, but still I expect a Rust web framework performing a ...
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
“Finding the Boundaries” Hero’s Journey with Noel Rappin @noelrappin Even when you’re ultimately right about what the future ho...
New
dimitarvp
Small essay with thoughts on macOS vs. Linux: I know @Exadra37 is just waiting around the corner to scream at me “I TOLD YOU SO!!!” but I...
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
Exadra37
Oh just spent so much time on this to discover now that RancherOS is in end of life but Rancher is refusing to mark the Github repo as su...
New
AstonJ
Seems like a lot of people caught it - just wondered whether any of you did? As far as I know I didn’t, but it wouldn’t surprise me if I...
New
PragmaticBookshelf
Author Spotlight Jamis Buck @jamis This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for Prog...
New
PragmaticBookshelf
Author Spotlight: Bruce Tate @redrapids Programming languages always emerge out of need, and if that’s not always true, they’re defin...
New