I keep vacillating on whether to use Go or Rust for my next cli or desktop tool (eg., for desktop egui in Rust). However, every time I see C or start to write it, I just see in it too much fun. In Go I see boredem, and Rust, frustration. I'm not writing production software for a large audience, at best tools for myself which a few others might use. Yet, it also seems a waste to be using what many now regard as out da…
... and arrays that don't decay to pointers. (Which, in my opinion, is C's real million-dollar mistake, not null pointers.) Oh, and less undefined behaviors.
typedef struct { byte *data; u64 len; } array;
typedef struct { byte *data; u64 len; u64 cap; } vec;
typedef struct { byte *data; u64 len; } string;
etc.Then developers will adhere to those apis, so long as, one's own array-struct decays to the above, so there can be standard library fns against the above, eg.,
sort(array *a);
etc.