News for hackers. Stuff that matters.
Re:Android's new Bluetooth stack rewrite (Gabeldorsh) is wri... by nerpderp82 on Wednesday March 31, 2021 @12:05PM (#26648974)
And it doesn't have memory safety. Zig is really fun and it is excellent for small wasm modules, but until it gets memory safety it will never be a Rust alternative.
Re:Android's new Bluetooth stack rewrite (Gabeldorsh) is wri... by est31 on Wednesday March 31, 2021 @12:07PM (#26648995)
More on the missing memory safety of Zig: https://scattered-thoughts.net/writing/how-safe-is-zig/

Discussion from 9 days ago: https://news.ycombinator.com/item?id=26537693

Re:Android's new Bluetooth stack rewrite (Gabeldorsh) is wri... by nerpderp82 on Wednesday March 31, 2021 @02:43PM (#26651285)
Thanks for the links. I donate a pittance to Zig, I really want to see where CTFE goes. If nothing else, Zig pushes the state of the art and every time a new system does, it sets the lower bound (hopefully) for the future.
Re:Android's new Bluetooth stack rewrite (Gabeldorsh) is wri... by jmull on Wednesday March 31, 2021 @07:36PM (#26654640)
Safety is a matter of degree, not an absolute. Unsafe Rust isn't safe. Not to mention, safe Zig isn't unsafe. And, if you want a lot of memory safety -- more than Rust in some ways -- you can use something like Javascript.
Re:Android's new Bluetooth stack rewrite (Gabeldorsh) is wri... by ttt0 on Wednesday March 31, 2021 @01:17PM (#26650059)
C++ doesn't have "memory safety" and it is a Rust alternative. Stop being pretentious, not every language has to have Rust's borrow checker or whatever its called.
Re:Android's new Bluetooth stack rewrite (Gabeldorsh) is wri... by pjmlp on Thursday April 01, 2021 @02:30AM (#26657231)
C backwards compatibility doesn't help, but it definilty does have the opt-in tooling to make it way safer than using C, although it isn't Ada safe IDE improvements for live static analysis do help.
Re:Android's new Bluetooth stack rewrite (Gabeldorsh) is wri... by andoriyu on Wednesday March 31, 2021 @03:16PM (#26651728)
But C++ does have opt-in memory safety via smart pointers and RAII. It's not preventing all the bug types hat rust will, but it is. There is also tons of code written without it, but you get the idea.

Zig misses a lot of futures that modern C++ has without offering anything in return. Yeah, it's easy to learn compared to C++ and Rust, but what the point of learning it if doesn't offer anything new?

Re:Android's new Bluetooth stack rewrite (Gabeldorsh) is wri... by ttt0 on Wednesday March 31, 2021 @04:05PM (#26652395)
I agree, but nothing short of borrow checker is considered memory safety to Rust advocates and they probably think that we segfault at least 10 times an hour with use-after-free's, double-free's and buffer overflows.

I don't think Zig is meant to replace C++. It's a cool language on its own.

By the way, you've been shadowbanned if you haven't noticed it yet.