3 ms·
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 i
by mjburgess 3y ago
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 dated tech.
It would be a great thing if a C-2030 could be arranged with a new standard library and a move-semantics compiler mode (say).
- teo_zero 3y ago... 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.
- mjburgess 3y agoThat's seems fixable with a standard library, if you define, 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.
- teo_zero 3y agoSure, but you lose the simplicity of accessing items with a[index], literals {1, 2, 3}, and initialization.
- stouset 3y agoRust is frustrating if you try to write code in it like you would in languages you already know, and assume the borrow checker is just an annoyance you’re supposed to `clone()` your way out of. If you try and learn what the ownership rules in the compiler are trying to teach you—admittedly less comprehensibly at times than you might prefer—about software design, it is an incredibly fun and rewarding language that will shape the way you write software in every other language.
- UncleOxidant 3y agoWhat about zig? A lot of the freedom of C with a few more guarantees but not as frustrating as Rust.
- mjburgess 3y agomjburgess meets zig: https://www.youtube.com/watch?v=NtW_cY6Mpsg https://www.youtube.com/watch?v=NtW_cY6Mpsg