3 ms·
Emphasis on 'builtin' :) For example, Zig's slice type is a 'builtin struct' which contains a pointer and size, the builtin error union type is made of an erro
by flohofwoe 4y ago
Emphasis on 'builtin' :)
For example, Zig's slice type is a 'builtin struct' which contains a pointer and size, the builtin error union type is made of an error code and the actual result type. These things are not provided by the Zig standard libary, but instead built into the language.
In contrast, C's builtin types are all 'primitives' (pointers, integers and floats) - with the arguable exception of VLAs, which have been made non-mandatory in C11.
- uecker 4y agoWe made VLA types and derived types (variably modified types) mandatory in C23. (but not VLAs on the stack as automatic variables which are still optional)