ChanServ changed the topic of #zig to: zig programming language | https://ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
xd1le has quit [Quit: Quit]
nvmd has quit [Quit: Later nerds.]
a_chou has joined #zig
_Vi has quit [Ping timeout: 244 seconds]
zandery23 has joined #zig
xd1le has joined #zig
msingle has quit [Ping timeout: 240 seconds]
_whitelogger has joined #zig
ur5us has quit [Ping timeout: 240 seconds]
ur5us has joined #zig
nephele_ has joined #zig
nephele has quit [Ping timeout: 240 seconds]
nephele_ is now known as nephele
factormystic has joined #zig
jasom has joined #zig
zandery23 has quit [Remote host closed the connection]
marnix has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
waleee-cl has quit [Quit: Connection closed for inactivity]
riba has joined #zig
riba has quit [Ping timeout: 256 seconds]
marnix has quit [Ping timeout: 265 seconds]
marnix has joined #zig
jasom has quit [Ping timeout: 272 seconds]
jasom has joined #zig
ur5us has quit [Ping timeout: 260 seconds]
cole-h has quit [Quit: Goodbye]
xd1le has quit [Ping timeout: 240 seconds]
knebulae has quit [Read error: Connection reset by peer]
knebulae has joined #zig
factormystic1 has joined #zig
factormystic has quit [Read error: Connection reset by peer]
factormystic1 is now known as factormystic
a_chou has quit [Quit: a_chou]
xd1le has joined #zig
marnix has quit [Remote host closed the connection]
marnix has joined #zig
oxymoron93 has joined #zig
klltkr has joined #zig
_Vi has joined #zig
KoljaKube has quit [Quit: buh-bye]
KoljaKube has joined #zig
klltkr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
klltkr has joined #zig
klltkr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
klltkr has joined #zig
xd1le has quit [Read error: Connection reset by peer]
xd1le has joined #zig
klltkr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
brotein has joined #zig
klltkr has joined #zig
factormystic has quit [Quit: The Lounge - https://thelounge.chat]
factormystic has joined #zig
cr1901_modern has quit [Read error: Connection reset by peer]
nullheroes has quit [Quit: WeeChat 2.9]
cr1901_modern has joined #zig
oxymoron93 has quit [Quit: Connection closed]
waleee-cl has joined #zig
vegai has joined #zig
klltkr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
klltkr has joined #zig
xackus has joined #zig
klltkr has quit [Client Quit]
klltkr has joined #zig
xd1le has quit [Remote host closed the connection]
pentlander has joined #zig
pentlander has quit [Remote host closed the connection]
a_chou has joined #zig
traviss_ has joined #zig
traviss has quit [Ping timeout: 240 seconds]
sawzall has quit [Read error: Connection reset by peer]
sawzall has joined #zig
sawzall has quit [Read error: Connection reset by peer]
sawzall has joined #zig
cole-h has joined #zig
klltkr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
klltkr has joined #zig
sawzall has quit [Read error: Connection reset by peer]
traviss__ has joined #zig
sawzall has joined #zig
traviss_ has quit [Ping timeout: 240 seconds]
<andrewrk> klltkr, if you install qemu you should in theory be able to reproduce failures on drone CI
<klltkr> Ah cool, I'll give that a go
cole-h has quit [Quit: Goodbye]
a_chou has quit [Quit: a_chou]
cole-h has joined #zig
brotein has quit [Remote host closed the connection]
brotein has joined #zig
brotein has quit [Ping timeout: 260 seconds]
st4ll1 has quit [Ping timeout: 264 seconds]
st4ll1 has joined #zig
nullheroes has joined #zig
pangey has quit [Ping timeout: 272 seconds]
pangey has joined #zig
klltkr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
st4ll1 has quit [Ping timeout: 256 seconds]
st4ll1 has joined #zig
<ifreund> wow, that msvc CI build has been chugging along for all of four hours now
<andrewrk> we're right up against the 6hr limit
<andrewrk> the good news is that most PRs don't need a windows CI pass
<leeward> ouch
<leeward> Is it CPU bound?
cr1901_modern has quit [Quit: Leaving.]
cr1901_modern has joined #zig
drewr has quit [Ping timeout: 240 seconds]
drewr has joined #zig
cole-h has quit [Quit: Goodbye]
cole-h has joined #zig
marnix has quit [Ping timeout: 258 seconds]
<KoljaKube> Using a fluent builder for large C structs in Zig - yay/nay? (Basically I want to know if I'm missing a good/more idiomatic Zig alternative)
<ikskuh> fluent builder?
<ifreund> is that the Builder.foo().red(2).green(5).wheels(6) pattern?
<KoljaKube> const result = SomeStruct.configure().paramA(.OptionX).paramB(.OptionQ).build();
sawzall has quit [Read error: Connection reset by peer]
sawzall has joined #zig
<ifreund> i think the zig pattern is passing an options struct
<ifreund> see e.g. std.fs.File.OpenFlags
<KoljaKube> That's an anonymous struct that gets its set fields copied to the result?
* KoljaKube looks
<ikskuh> KoljaKube: look at std.mem.zeroInit
<ifreund> you can set default values for all the fields so that to get a "default" struct you just do Foo(.{});
<KoljaKube> Yeah, I'm using std.mem.zeroes right now, but builder makes it relatively easy to do the Zig->C type conversions inline
<ikskuh> zeroes != zeroInit!
<KoljaKube> zeroInit is what I described two lines above, right?
<ikskuh> kinda :D
<ikskuh> it initializes all fields with default value or a zero value and overrides the values given
marnix has joined #zig
<KoljaKube> Maybe I didn't express myself well, but I think we mean the same thing
<KoljaKube> I'm still figuring out how to nicely bridge between Zig and C values
<KoljaKube> Don't want to @ptrCast or @intCast everywhere on initialization
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
<KoljaKube> This stuff is great for finding the not-yet-fleshed-out parts of the compiler btw ;-)
brotein has joined #zig
marnix has quit [Ping timeout: 240 seconds]
brotein has quit [Ping timeout: 240 seconds]
sawzall has quit [Read error: Connection reset by peer]
sawzall has joined #zig
klltkr has joined #zig
a_chou has joined #zig
<dkibi> do I see it correctly, that the zig parser is hand built? is there a reason for that?
<andrewrk> what's the alternative?
<ikskuh> dkibi: to my experience, everything else will lead to more problems in the end
<companion_cube> andrewrk: parser generators
<ikskuh> i'm super-happy atm that i've rewritten a parser and switched from a generated parser to a hand-written one
<dkibi> aren't parser generators super common? and there is a PEG grammar in the documentation I thought at first that was used
<dkibi> this is really just curriosity on my side
<ikskuh> easier to understand, maintain and it's more convenient to recover
<andrewrk> companion_cube, shhh, I'm doing socratic method
<ikskuh> also, andrewrks question is real: do we have parser generators for zig yet? :D
<companion_cube> you could have written a parser generator *for* zig :)
<andrewrk> a third party parser generator is an additional bootstrapping dependency
<andrewrk> it also puts some things outside of zig's control such as error messages, memory usage, and how state is stored
<dkibi> I thought would be the most likely answer ^^
<andrewrk> anyway I think hand building is the null hypothesis
<companion_cube> could still be worth having a reference yacc parser, just to make sure the grammar is well behaved
<companion_cube> (like a typechecker for parsers, really)
<ifreund> hmm, gpa.create(std.SinglyLinkedList(Session).Node) or gpa.create(@TypeOf(sessions).Node)
<ifreund> I kinda like the second one but had never considered it before now
gert_ has joined #zig
<andrewrk> companion_cube, we have a reference PEG: https://github.com/ziglang/zig-spec/tree/master/grammar
<cr1901_modern> I had a friend help me improve my Zig code... are there any special rules re: using comptime vars with vars that aren't comptime: https://github.com/cr1901/zig-aoc2016/blob/master/day2/keypads.zig#L11-L23
<cr1901_modern> Maybe this is a bad assumption, but I feel like comptime vars should only be allowed to be set via other comptime vars
<companion_cube> andrewrk: PEG doesn't help you find ambiguities, does it?
<companion_cube> since it resolves them by order of declaration
<ifreund> huh, I thought that the std event loop was supposed to work with --single-threaded https://paste.rs/PrU
<ifreund> well, looks like it works on master but not 0.6.0
<leeward> Oh, it's fixed on master?
<leeward> Last time I tried it, my program never terminated.
<ifreund> well, I haven't run my program yet :P
<ifreund> but it compiled
<leeward> hah, ok
<ifreund> I don't actually intend for this program to terminate anyhow lol
<leeward> Well no problem then.
<andrewrk> it's fixed on master? that's news to me
<andrewrk> --single-threaded event loop not to be confused with std.event.Loop.initSingleThreaded() which still uses threads internally but gives you a single-threaded async/await model to code your application against
<andrewrk> cr1901_modern, I think your assumption is correct. you may have found a bug
klltkr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<cr1901_modern> sweet :D! If I knew what the hell I was doing, then I would make a bug report
<ifreund> andrewrk: well, it compiles on master and partially works but something fishy is definitely happening
<ifreund> how do I make it use initSingleThreaded if not by building with --single-threaded?
JX7P has left #zig ["Leaving"]
a_chou has quit [Ping timeout: 265 seconds]
* cr1901_modern reads pamphlet "So You May Have Found A Bug In Zig. Here's What To Do Next." ^ andrewrk: Should I just make that example smaller, open a bug, and you can tell me whether it's actually a bug?
<andrewrk> ifreund, that's a great question. I think maybe start.zig is missing a feature that would be handy to get this behavior (by inspecting @import("root") and looking for `i_want_single_threaded_event_loop`)
<ifreund> yeah it seems that the only option currently is to declare @import("root").event_loop; and write your own custom startup code
<andrewrk> you can always set it up yourself. the start.zig code for setting up the event loop is not doing much
<ifreund> I think I'll end up shaving this yak eventually, but not tonight
<ifreund> single threaded async zig code seems to express what I want my program to do very nicely
a_chou has joined #zig
factormystic has quit [Quit: Ping timeout (120 seconds)]
a_chou has quit [Remote host closed the connection]
factormystic has joined #zig
ur5us has joined #zig
factormystic has quit [Quit: Ping timeout (120 seconds)]
factormystic has joined #zig
factormystic has quit [Client Quit]
rlr has joined #zig
ur5us has quit [Ping timeout: 256 seconds]
ur5us has joined #zig
ur5us_ has joined #zig
ur5us has quit [Ping timeout: 240 seconds]