jarkko,
@jarkko@social.kernel.org avatar

i hope will be sustainable. i like its way more than . and like in C or even RISC-V microarchitecture, but not so much in Rust and C++, the language definition is compact enough so that it just stick into your head. also, comptime is really cool invention in my opinion. #C

https://ziglang.org/

zethtren,
@zethtren@mastodon.social avatar

@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,
@jarkko@social.kernel.org avatar

@zethtren thanks for the remark! there's other things also that i like, e.g. fine grain control to memory policy. it allows to easily at least mitigate from memory allocation failures, which requires effort in Rust. and I like the way FFI works in zig. that said, not real experience with the language but i think it does deserve its existence :-) it would be interesting see how those ideas mature over time...

zethtren,
@zethtren@mastodon.social avatar

@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,
@jarkko@social.kernel.org avatar

@zethtren I don't really know anything about where trends and hype is at either :-) I just see bunch of useful applications with emphasis on modernising legacy C software (thanks to robust FFI) and also anything where executable size is critical it seems to have its edge...

mo8it,
@mo8it@fosstodon.org avatar

@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.)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • zig
  • tacticalgear
  • DreamBathrooms
  • mdbf
  • InstantRegret
  • ngwrru68w68
  • magazineikmin
  • thenastyranch
  • Durango
  • rosin
  • Youngstown
  • slotface
  • khanakhh
  • kavyap
  • ethstaker
  • JUstTest
  • cubers
  • cisconetworking
  • normalnudes
  • modclub
  • everett
  • osvaldo12
  • GTA5RPClips
  • Leos
  • anitta
  • tester
  • provamag3
  • megavids
  • lostlight
  • All magazines