News for hackers. Stuff that matters.
Re:Why Zig over C for Systems Programming by raverbashing on Friday November 13, 2026 @10:30AM (#50484972)
Yeah

The lack of a native slice is the most glaring C fault I think exists

(And of course the committees won't implement it, and of course C is going to remain broken)

Re:Why Zig over C for Systems Programming by brabel on Friday November 13, 2026 @11:19AM (#50485724)
I don’t get it, C arrays can be used as slices, no?? Given a pointer and a length, which is how C does any array, works just as well (I mean if you consider arrays without a length a fine thing) as a slice!
Re:Why Zig over C for Systems Programming by jandrese on Friday November 13, 2026 @01:18PM (#50487525)
Sure you can do that, but you end up having to re-implement all of the standard library functions that expect to work with zero terminated arrays.
Re:Why Zig over C for Systems Programming by uecker on Friday November 13, 2026 @11:21AM (#50485751)
You could help? https://www.open-std.org/jtc1/sc22/wg14/www/contributing.htm...

But I am also quite happy about how far one already gets with variably modified types and a custom span type: https://godbolt.org/z/rPen5Movd