Re:How I Built Zig-SQLite
by throwawaymaths on Friday May 27, 2022 @12:19PM
(#31531362)
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.
Re:How I Built Zig-SQLite
by soggybutter on Friday May 27, 2022 @10:06AM
(#31529792)
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
Re:How I Built Zig-SQLite
by noodledoodletwo on Friday May 27, 2022 @11:06AM
(#31530470)
Thanks for explaining, I really appreciate it.
Re:How I Built Zig-SQLite
by orangetuba on Friday May 27, 2022 @10:40AM
(#31530197)
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.
Just semantics, but I think the borrow checker is part of modernizing C++.
(The way to manage memory in C++ and C is to opt in to a memory management pattern... hopefully you've chosen a good pattern and hopefully you follow it consistently. Patterns are generally backed by utilities and primitives that are hopefully correct, complete, and hopefully make it relatively easy to follow the pattern consistently. Hopefully you can get a linter to help you too. In a sense Rust takes the same approach, but was implemented from the ground up to eliminate all the gaps so you essentially don't have to hope to successfully bridge the gaps yourself.)
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.