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:

Where Next?

Popular Backend topics Top

AstonJ
Thought this video was interesting: What are your thoughts? Any areas you agree/disagree? Which web-dev tech do you think is worth ado...
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
wolf4earth
Serverless has been quite a prevalent topic in our industry in the past few years, and while there are a lot of sceptics, I think it’s sa...
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
New
AstonJ
Just discovered Fika - looks pretty neat! fn sum(a: Int, b: Int) : Float do a + b end I quite like the syntax, though would probably ...
New
Jsdr3398
I just thought of this. Are there any disadvantages when making your server in Assembly (other than having to learn a bunch of stuff :ro...
New
KnowledgeIsPower
Do you just use plain Terraform alone? Do you use CDK for Terraform or other supporting tools (e.g. Terraform Cloud ) for Terraform?
New
jss
If you like video courses, maybe you should try this: https://clojureforpros.com/
New

Other popular topics Top

AstonJ
poll poll Be sure to check out @Dusty’s article posted here: An Introduction to Alternative Keyboard Layouts It’s one of the best write-...
New
New
AstonJ
I ended up cancelling my Moonlander order as I think it’s just going to be a bit too bulky for me. I think the Planck and the Preonic (o...
New
PragmaticBookshelf
Build highly interactive applications without ever leaving Elixir, the way the experts do. Let LiveView take care of performance, scalabi...
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
rustkas
Intensively researching Erlang books and additional resources on it, I have found that the topic of using Regular Expressions is either c...
New
mafinar
This is going to be a long an frequently posted thread. While talking to a friend of mine who has taken data structure and algorithm cou...
New
PragmaticBookshelf
Author Spotlight James Stanier @jstanier James Stanier, author of Effective Remote Work , discusses how to rethink the office as we e...
New
AstonJ
Was just curious to see if any were around, found this one: I got 51/100: Not sure if it was meant to buy I am sure at times the b...
New
DevotionGeo
I have always used antique keyboards like Cherry MX 1800 or Cherry MX 8100 and almost always have modified the switches in some way, like...
New