Hacker News new | ask | show | jobs
by Bekwnn 2095 days ago
I think Zig competes with a school of C++ that tries to stick to a simpler, limited subset of C++. Games is one area where C++ is much more common than C, but also where a lot of C++ practices (exceptions, excessive template use, many parts of the stdlib) are discouraged and things tend to be kept "simpler".

I'm sure there are a good handful of other fields that currently write "minimal C-like C++" and I think Zig competes with C++ in those cases.

1 comments

But Zig has counterparts to exceptions, templates and anything you may want to do with them; it compares quite nicely with even "rich" C++. The one thing it intentionally doesn't have is operator overloading. In general, I'd say that the difference between Zig and C++ is that when you do some clever stuff in Zig, you need to be explicit about it so that the reader knows this call-site uses dynamic dispatch or that there is a destructor being called or that this operation isn't really the standard +.