ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
<andrewrk>
I should probably add a section to that about the kinds of undefined behavior that cannot be prevented, such as *@intToPtr(&usize, randomInteger(usize)) = randomInteger(usize);
<andrewrk>
in zig you could convert a random number to a pointer then write a random value to it. this could have undefined behavior if the address overlapped with memory that was in use
<hio>
I assume this is left in the language to have it be compatible with C?
<andrewrk>
not quite
<andrewrk>
it's in the language because it's a feature used to build operating systems and embedded software
<andrewrk>
more generally, zig is a language for generating object files, libraries, and executables
<andrewrk>
and one of the (useful) features of machine code is that you can cast an integer to a pointer and read/write
<andrewrk>
and so zig supports it
<andrewrk>
zig also supports inline assembly
cenomla has quit [Quit: cenomla]
arBmind has quit [Ping timeout: 256 seconds]
<DuClare>
Hm. How do you do a C-like conversion of negative signed integer to some unsigned type without UB?