Hacker News new | ask | show | jobs
by throwaway17_17 1088 days ago
The most frequently given reason is that a core principle for Zig is ‘No implicit control flow’ or just the more general ‘Explicit is always better’. RAII, both for constructors and destructors are inherently implicit control flow constructs, also they usually involve access to allocation primitives, which Zig also rejects when implicit.

You can disagree with the language principles if that is one’s position. However, the ‘resistance’ to RAII is a clear effect of those principles.

1 comments

I assume that zig requires the programmer to also manually allocate and free stack frames? And it eschews functions as they can hide allocations and control flows?
I would assume "allocation primitives" is referring to the heap.