3 ms·
> I quickly discovered that I really like Zig because it feels like C! I honestly cannot imagine anyone feeling this way. Here's some code randomly pulled from
by bachmeier 2y ago
> I quickly discovered that I really like Zig because it feels like C!
I honestly cannot imagine anyone feeling this way. Here's some code randomly pulled from the Zig website:
const std = @import("std");
pub fn main() void {
const msg = "hello this is dog";
var it = std.mem.tokenize(u8, msg, " ");
while (it.next()) |item| {
std.debug.print("{s}\n", .{item});
}
}
That's the kind of code you write with Zig. It's definitely not C. The author probably means something else, but to me the two are very different.
- dralley 2y ago"feels like C" and "looks like C" are not quite the same thing. That Zig feels like a modern C is a very common opinion.
- bachmeier 2y agoIMO, only in the sense that many languages feel like a modern C. The differences between C and the Zig code are much more than just syntax.
- jandrewrogers 2y agoThat's just syntax. Once you get past the syntax, the structure and flow of the language feels like a highly evolved C. Zig has a high degree of mechanical sympathy with C programmer brains.
- bachmeier 2y agoThe author wrote "it feels like C". You're saying "the language feels like a highly evolved C". Those are two very different things. I agree with your statement but "highly evolved" implies they're substantially different.