News for hackers. Stuff that matters.
Re:Comments Are Code (2018) by pyrolistical on Thursday March 07, 2024 @08:17PM (#39636670)
I find to be true writing zig that calls into a c-api. Often c cannot express what it really wants to do, so they document it in the comments. But since zig is more expressive than c, I can translate those comments into actual zig code.

A simple example is `Foo * foo`

That could be an input pointer, out parameter, array or it might be allowed to be null.

In zig we can express each one distinctly and all combinations.

There are no comments on this comment yet.