ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
arBmind has quit [Quit: Leaving.]
hoppetosse has quit [Ping timeout: 252 seconds]
<GitHub102> [zig] andrewrk pushed 1 new commit to master: https://git.io/vNs1h
<GitHub102> zig/master 3268276 Andrew Kelley: the same string literal codegens to the same constant...
m6w6 has quit [Ping timeout: 255 seconds]
m6w6 has joined #zig
<GitHub143> [zig] andrewrk opened pull request #684: *WIP* error return trace proof of concept (master...wip-err-ret-trace) https://git.io/vNsAz
hoppetosse has joined #zig
arBmind has joined #zig
arBmind has quit [Quit: Leaving.]
skyfex has quit [Ping timeout: 260 seconds]
hoppetosse has quit [Ping timeout: 268 seconds]
arBmind has joined #zig
hoppetosse has joined #zig
arBmind has quit [Read error: Connection reset by peer]
DuClare has joined #zig
cenomla has joined #zig
meena has quit [*.net *.split]
meena has joined #zig
hoppetosse has quit [Ping timeout: 265 seconds]
arBmind has joined #zig
hio has joined #zig
<hio> Is it explained somewhere why some unbehaved behavior cannot be prevented?
<hio> undefined*
<andrewrk> hio, this explains some concepts: http://ziglang.org/documentation/master/#undefined-behavior
<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?
<andrewrk> DuClare, @bitCast(DestinationType, value)
<andrewrk> I should add that to the docs
<andrewrk> there's also @truncate(DestinationType, value)
<DuClare> Nice
hoppetosse has joined #zig