@jarkko I feel like comptime is one of those things that’s convenient at first. But, then you build a function that’s restricted solely by compiler checks and doesn’t have a “proper” interface.
If anyone tries to develop on comptime you either have to document the requirements, let the users figure it out by compiler errors, or wrap it in interface functions. Plus any change can break code down the line.
It seems cool at first but, I like it less the more I look at it.
@jarkko When you say "sustainable" do you mean "the project is enduring" or "sustainable ecologically?"
@jarkko Yeah it definitely has a lot of neat things (Super great for systems level stuff). I personally feel the ergonomics fall apart a bit in the module level scope of things. The FFI (especially with C) is definitely fantastic though.
I don’t have much direct experience with Zig except for friends that share their hype with me. So I can’t speak for it directly. Rust does provide a surprising amount of “experimental” and “nightly” features for memory though too.
@jarkko in rust you have the const keyword for that (but not all operations can be done in a const function)
@jarkko @zethtren Zig is NOT memory safe. A huge step backwards…
Here is a proof from the most famous project written in Zig - Bun:
https://github.com/oven-sh/bun/issues?q=segfault
Note that segfaults are harmless in comparison with other memory issues.
Here is some use-after-free for another example:
https://github.com/oven-sh/bun/issues/9093#issue-2152496603
I am not for Rust over all other languages. But Zig is a danger if it gets adopted. It goes against all the initiatives towards memory safety (e.g. US government, Google, Microsoft, etc.)
@jarkko @mo8it @zethtren Interesting to know. I personally lean more in favor of Rust in my application development. I totally understand its appeal. Especially from post C devs and devs that are used to doing hacky things with memory. But, this does shed some light on some of the claims Zig makes that I’ve been skeptical of.