Live data from Hacker News

Shecc: A self-hosting and educational C optimizing compiler

github.com

21–23 of 23 posts

Re: Shecc: A self-hosting and educational C optimizing compiler

#21

Earlier quoted context omitted.

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

That'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.

Sure, but you lose the simplicity of accessing items with a[index], literals {1, 2, 3}, and initialization.

Re: Shecc: A self-hosting and educational C optimizing compiler

#22

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…

What about zig? A lot of the freedom of C with a few more guarantees but not as frustrating as Rust.

mjburgess meets zig: https://www.youtube.com/watch?v=NtW_cY6Mpsg
Post reply on HN