Hacker News new | ask | show | jobs
by lionkor 5 days ago
On modern OSs you can write Zig and just ignore allocation errors. It doesn't force you to handle them properly.

This language exists to supercede or supplement C, not JavaScript or C#.

It's practical applicability is similar to that of C, so I struggle to comprehend how it is "so small".

1 comments

> On modern OSs you can write Zig and just ignore allocation errors.

I can ignore errors, but I still need to free memory manually if I want to avoid memory leaks. Languages like C++ or Rust have destructors, which do the job for me.

> This language exists to supercede or supplement C

There are way better alternatives, like Rust. Even C++ is better.

Zig has defer, your point is quite invalid.
defer can be forgotten to be written. C++ always calls destructors for local variables without additional programmer's intervention needed.