ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
<unique_id> I really like doing "if (comptime expr)" instead of "if (expr)" to highlight the comptness of the branching when the if statement isn't top-level. It's awesome that I can just do that.
<unique_id> The branching is unecessary though. I have a field in a struct that's sometimes the void type, so I comptime branch to skip setting it, but I might just let the compiler remove the code instead! void is really cool
kristate has joined #zig
kristate has quit [Remote host closed the connection]
<scientes> unique_id, I agree, its like #ifdef HAVE_EXPR
kristate has joined #zig
kristate has quit [Remote host closed the connection]
kristate has joined #zig
JinShil has joined #zig
kristate has quit [Remote host closed the connection]
kristate has joined #zig
<scientes> how do i zero-initialize something?
<scientes> *a struct
<scientes> is there a shortcut?
<scientes> nvm
andrewrk has joined #zig
kristate has quit [Ping timeout: 244 seconds]
kristate has joined #zig
<kristate> scientes: var s: myStruct = undefined;
pdmer has joined #zig
pdmer has quit [Client Quit]
pdmer has joined #zig
pdmer has quit [Client Quit]
pdmer has joined #zig
pdmer has quit [Quit: pdmer]
davr0s has joined #zig
kristate has quit [Remote host closed the connection]
pdmer has joined #zig
zolk3ri has joined #zig
pdmer has quit [Quit: pdmer]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
kristate has joined #zig
kristate has quit [Ping timeout: 244 seconds]
JinShil has quit [Quit: Leaving]
Tobba has quit [Remote host closed the connection]
pdmer has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pdmer has quit [Quit: pdmer]
davr0s has joined #zig
pdmer has joined #zig
mahmutov has quit [Ping timeout: 244 seconds]
pdmer has quit [Client Quit]
pdmer has joined #zig
pdmer has quit [Quit: pdmer]
pdmer has joined #zig
pdmer has quit [Client Quit]
pdmer has joined #zig
pdmer has quit [Client Quit]
pdmer has joined #zig
pdmer has quit [Quit: pdmer]
<unique_id> kristate: that does not zero initialize the struct. It doesn't initialize it to anything.
pdmer has joined #zig
<unique_id> scientes: I know you said nvm but just in case... You'll have to do "= undefined" and then @memset(...) or maybe there's some std function as well.
<MajorLag> There is no simple way to zero initialize a struct. I wrote a computime utility function for it: https://paste.ubuntu.com/p/m6rGQqRkgV/
<unique_id> cool, and I just noticed that @memset isn't recommended. A for loop is better like you did.
pdmer has quit [Quit: pdmer]
pdmer has joined #zig
noonien has joined #zig
zolk3ri has quit [Quit: leaving]
zolk3ri has joined #zig
pdmer has quit [Quit: pdmer]
pdmer has joined #zig
pdmer has quit [Client Quit]
bheads has joined #zig
bheads has quit [Remote host closed the connection]
pdmer has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pdmer has quit [Quit: pdmer]
mahmutov has joined #zig
pdmer has joined #zig
pdmer has quit [Quit: pdmer]
pdmer has joined #zig
pdmer has quit [Client Quit]
davr0s has joined #zig
kristate has joined #zig
kristate has quit [Ping timeout: 256 seconds]
ft3 has joined #zig
bheads has joined #zig
kristate has joined #zig
<kristate> hi back online
bheads has quit [Disconnected by services]
bheads has joined #zig
schroffl has joined #zig
mahmutov has quit [Ping timeout: 240 seconds]
ft3 has quit [Quit: leaving]
mahmutov has joined #zig
kristate has quit [Remote host closed the connection]
return0e has quit [Ping timeout: 256 seconds]
return0e_ has joined #zig
schroffl has quit [Remote host closed the connection]
hooo has joined #zig
haolez has quit [Quit: Page closed]
<hooo> how long until 1.0?
mahmutov has quit [Ping timeout: 256 seconds]
bheads has quit [Ping timeout: 240 seconds]
mahmudov has joined #zig
<andrewrk> hooo, 2 years
<andrewrk> I'm streaming in 8 minutes: https://www.twitch.tv/andrewrok
wink_ has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<unique_id> excellent
wink_ has joined #zig
pdmer has joined #zig
pdmer has quit [Quit: pdmer]
pdmer has joined #zig
pdmer has quit [Quit: pdmer]
noonien has quit [Quit: Connection closed for inactivity]
pdmer has joined #zig
hooo has left #zig [#zig]
pdmer has quit [Client Quit]
zolk3ri has quit [Remote host closed the connection]
pdmer has joined #zig
pdmer has quit [Quit: pdmer]
kristate has joined #zig
kristate has quit [Remote host closed the connection]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<unique_id> andrewrk: Do you not want to start with OpenGL and then you or others can port later to vulkan? It seems like vulkan could be an enormous distraction and could also cause streaming problems. Even with validation layers you could have issues with your system becoming unresponsive / it being difficult to shut down your program. Vulkan is also so low level that it might not make sense for 99% of the apps to write directly in vulkan.
<unique_id> Take a look at https://github.com/floooh/sokol - It supports metal and d3d11 but not d3d12 and vulkan yet. You could think of Vulkan as requiring half the driver to be in your application but it hardly makes sense to repeat that work for each application
<unique_id> so something like sokol might be ideal in the future
<unique_id> The guy that wrote sokol wrote an interesting post about "One Year of C" (having been a C++ programmer). Notice a pattern? :) - http://floooh.github.io/2018/06/02/one-year-of-c.html