3 ms·
> information hiding An interesting point, especially at API boundaries. C and Zig not having information hiding is to some extent a feature. C++ is notorious
by Animats 4y ago
> information hiding
An interesting point, especially at API boundaries.
C and Zig not having information hiding is to some extent a feature.
C++ is notorious for having information hiding without safety. Almost no other language has that combination.
- kps 4y agoI certainly understand the Zig core's arguments, but I don't think they'll matter in the places where these C coding standards are used. I'm sure an external linter could solve the problem using some naming convention or magic comments, but I'm not sure it'll get far enough for that to be written. [Edit: there does seem to be community interest in metadata annotations for external static analysis https://github.com/ziglang/zig/issues/14656 https://github.com/ziglang/zig/issues/14656 ] Although I only have a beginner knowledge of the language, it seems to me that Zig is just on the edge of being able to provide a nice unification of the C opaque-pointer idiom with other opaque handles (e.g. POSIX file descriptors, GL handles).