News for hackers. Stuff that matters.
Re:Zig 0.8.0 Release Notes by ncmncm on Saturday June 05, 2021 @03:54AM (#27403129)
You almost got there.

What makes a language powerful is the ability to put essential semantics into a library where they can be got right once, so all users of the library benefit. It is worth design, implementation, testing, optimization effort if the results can be delivered over and over, in many different contexts, reliably.

Destructors are the necessary ingredient to pull transaction semantics into libraries. Without, you are left to write comments explaining users' responsibilities, and users have to read and act on them perfectly, or be wrong. With, you can code them correctly once and users have no opportunity or temptation to get them wrong.

Re:Zig 0.8.0 Release Notes by papaf on Saturday June 05, 2021 @04:23AM (#27403256)
I agree with your comment about libraries. Destructors biggest advantage is in well used libraries.

Any interesting code involves custom classes written by less experienced developers that are only used once or twice in an application -- it is there that that the complexity of destructors hurt.

Re:Zig 0.8.0 Release Notes by ncmncm on Saturday June 05, 2021 @05:31PM (#27408616)
There certainly are design complexities in C++, around copy and move constructors and various operators. Some of those could have been avoided, in hindsight, and new languages can.

None of those complexities spill over onto destructors. They were perfect in their original conception, and are unchanged 40 years on. They evoke no regrets. No bugs trace to anything unfortunate about destructors.