Comment

Comment by IshKebab

I tried Zig a bit and found it quite nice, but it is very low level. Like in Rust you concatenate strings like this:

  let result = format!("{a}{b}{c}");
In Zig it's something like this:

  const allocator = std.heap.page_allocator;
  const parts = [_][]const u8{"a", "b"};
  const result = std.mem.concat(allocator, &parts[0], 2) catch @panic("allocation failure");
  defer allocator.free(result);
I dunno if I want to write any really significant programs like that. At least not any that use strings a lot!
parent IshKebab 1 year ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton