Re:Zig's New Relationship with LLVM
by pron on Tuesday September 29, 2020 @06:46AM
(#24626102)
Right, but in this case it's not a matter of what you have, but what you don't. Zig has slices as the only form of moving pointers around, and it doesn't have any pointer arithmetic. I.e. every time some data is traversed, the language ensures the size is known either at compile time or runtime.
[ Parent
| on HN ]
For the time being, https://github.com/ziglang/zig/issues/2018
This isn't exactly pointer arithmetic as in C (or in unsafe Zig, as with @intToPtr, or using the "unknown size" pointer type, [*]). This is talking about preserving size information, and only when the arithmetic is compile-time-known; so it's more "array arithmetic".