top | item 31528870

(no title)

winter_squirrel | 3 years ago

As someone who uses both for different personal projects:

- I use zig as my build system for both rust, zig, C libraries and linking since the build system works really well for this purpose

- When I need to write applications or libraries that can benefit from compile-time code, I always try and use zigs since it's much easier to use comptime then a combination of rust macros and generics

- I like the zig async story a lot better. Or at least it's much easier to wrap my head around and write code in compared to rust + tokyo

On the other hand, sometimes I know a project will benefit from the borrow checker or I want to use some of the awesome rust crates that the community made and I'll use rust instead.

discuss

order

noodledoodletwo|3 years ago

Does a really short summary of this read kind of like, "zig is a modern c, but I like using rust as a modern c++"?

Agree, Tokio is a little tricky for people new to rust no doubt, but it's tricky for a reason. It's saving lives in production.

throwawaymaths|3 years ago

Just FYI: things that are actually "saving lives" are probably realtime applications, which need things like deterministic execution time, no allocation from the os, bounded memory usage, which rust generally does not give you without a ton of effort.

soggybutter|3 years ago

This is actually the frame of reference I've taken to giving most folks. Zig is to C what Rust is to C++ in my mind. Is there a lot of overlap between all 4? Absolutely. But devs still choose C over C++ (and Rust) in some cases, and I think it'll be similar for Zig

orangetuba|3 years ago

Yes, but Rust offers something more than just modernizing C++. The borrow checker provides something entirely new that has the potential to make a huge impact.

verdagon|3 years ago

Can you elaborate on the savings lives part? I sense a good story, would love to hear.