ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
<GitHub84> [zig] jayschwa opened pull request #1256: Fixed minor documentation errors (master...fix-docs) https://git.io/fNGkn
adrusi has quit [Quit: ZNC 1.7.0 - https://znc.in]
adrusi has joined #zig
kristate has joined #zig
kristate has quit [Ping timeout: 264 seconds]
darithorn has joined #zig
<GitHub92> [zig] andrewrk closed pull request #1256: Fixed minor documentation errors (master...fix-docs) https://git.io/fNGkn
<GitHub13> [zig] andrewrk pushed 1 new commit to master: https://git.io/fNGqv
<GitHub13> zig/master 6394f7e Jay Weisskopf: Fixed minor documentation errors (#1256)...
kristate has joined #zig
donlzx has quit [Remote host closed the connection]
donlzx has joined #zig
zolk3ri has quit [Remote host closed the connection]
kristate has quit [Remote host closed the connection]
kristate has joined #zig
kristate has quit [Ping timeout: 240 seconds]
kristate has joined #zig
kristate has quit [Remote host closed the connection]
donlzx has quit [Remote host closed the connection]
donlzx has joined #zig
v1zix has joined #zig
kristate has joined #zig
redj_ has joined #zig
kristate has quit [Remote host closed the connection]
redj has quit [Ping timeout: 240 seconds]
redj_ is now known as redj
kristate has joined #zig
kristate has quit [Ping timeout: 248 seconds]
darithorn1 has joined #zig
darithorn has quit [Quit: Leaving]
darithorn1 has quit [Client Quit]
dbandstra has joined #zig
v1zix has quit [Ping timeout: 252 seconds]
<GitHub165> [zig] andrewrk pushed 1 new commit to master: https://git.io/fNG3F
<GitHub165> zig/master cbfe9a4 Andrew Kelley: fix @setEvalBranchQuota not respected in generic fn calls...
davr0s has joined #zig
andrewrk has quit [Ping timeout: 240 seconds]
kristate has joined #zig
andrewrk has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kristate has quit [Remote host closed the connection]
kristate has joined #zig
jwmerrill has quit [Ping timeout: 276 seconds]
edr has quit [Ping timeout: 276 seconds]
Tobba has quit [*.net *.split]
_whitelogger has joined #zig
kristate has quit [Remote host closed the connection]
monteslu has joined #zig
dvn has joined #zig
MajorLag1 has joined #zig
odc has joined #zig
bodie_ has joined #zig
atk has quit [Ping timeout: 240 seconds]
beetcoin has quit [Ping timeout: 260 seconds]
beetcoin has joined #zig
kristate has joined #zig
atk has joined #zig
dbandstra has quit [Quit: Leaving]
kristate has quit [Remote host closed the connection]
xtreak has joined #zig
kristate has joined #zig
kristate has quit [Remote host closed the connection]
ffnode has joined #zig
ffnode is now known as qazo
qazo has quit [Client Quit]
qazo has joined #zig
kristate has joined #zig
kristate has quit [Remote host closed the connection]
kristate has joined #zig
kristate has quit [Remote host closed the connection]
<GitHub56> [zig] thejoshwolfe pushed 1 new commit to master: https://git.io/fNGW4
<GitHub56> zig/master 843529d Josh Wolfe: implement proper utf16leToUtf8
kristate has joined #zig
<GitHub160> [zig] Hejsil pushed 1 new commit to master: https://git.io/fNG0V
<GitHub160> zig/master b7be082 Jimmi HC: -Dskip-release now also skips build example tests
kristate has quit [Remote host closed the connection]
xtreak has quit [Remote host closed the connection]
davr0s has joined #zig
xtreak has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
zolk3ri has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
xtreak has quit [Remote host closed the connection]
davr0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
davr0s has quit [Ping timeout: 240 seconds]
xtreak has joined #zig
very-mediocre has joined #zig
donlzx has quit [Quit: Leaving]
xtreak has quit [Remote host closed the connection]
<GitHub123> [zig] Hejsil opened pull request #1258: Allow pointers to any struct in extern/exported declarations (master...extern-ptr-to-everything) https://git.io/fNG5J
davr0s has joined #zig
bheads_ has joined #zig
bheads__ has quit [Ping timeout: 260 seconds]
<GitHub24> [zig] andrewrk pushed 1 new commit to master: https://git.io/fNGj2
<GitHub24> zig/master a8a1b5a Andrew Kelley: fix build on windows...
<GitHub128> [zig] andrewrk pushed 1 new commit to master: https://git.io/fNZTC
<GitHub128> zig/master cd488c9 Andrew Kelley: fix std.os.getAppDataDir test on linux
<GitHub117> [zig] andrewrk pushed 1 new commit to master: https://git.io/fNZTH
<GitHub117> zig/master c393a39 Andrew Kelley: fix invalid character test on windows
<GitHub78> [zig] andrewrk closed pull request #1258: Allow pointers to anything in extern/exported declarations (master...extern-ptr-to-everything) https://git.io/fNG5J
<GitHub145> [zig] andrewrk pushed 1 new commit to master: https://git.io/fNZIk
<GitHub145> zig/master fd3a41d Jimmi Holst Christensen: Allow pointers to anything in extern/exported declarations (#1258)...
stratact has joined #zig
qazo has quit [Ping timeout: 252 seconds]
Ichorio has joined #zig
Hejsil has joined #zig
Ichorio has quit [Read error: Connection reset by peer]
Hejsil has quit [Ping timeout: 252 seconds]
Bas_ has joined #zig
jjido has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<bheads_> andrewrk, I just got a chance to watch last weeks live stream, good stuff and thanks for doing it! Was the problem that the event pool was not working due to you still calling group.call (and not loop.call) in the arguments loop?
<andrewrk> this along with: await (async loop.yield() catch unreachable); // TODO simulate evented I/O for the file I/O below
<andrewrk> that yield is needed as a workaround for the file I/O being blocking instead of event-based
<andrewrk> and that catch unreachable is solved by this proposal that I just filed: https://github.com/ziglang/zig/issues/1260
<andrewrk> I'll do a quick demo of it working on thursday at the beginning of the stream :)
<bheads_> lol, all of the problems you ran into I had while writing a fiber based event dispatched in D
<andrewrk> ha!
<andrewrk> I'm annoyed by how long I spent figuring out how to propagate the error code up to the non-async code
<bheads_> ie, the main loop cannot be one of the worker, and you need to yeild
<andrewrk> hm, I still have the main loop being one of the workers
<bheads_> actually that is really hard to do parallel
<bheads_> I ended up having the main loop spin
<bheads_> then fall back to an os sleep
<andrewrk> makes sense. but I'm not settling for anything less than optimal >:-]
<bheads_> lol
<bheads_> if the main loop is a work you will always have issues
<bheads_> is a worker**
<andrewrk> why's that?
<bheads_> if you have a single blocking worker task there is a 1 in 4 chance that it is a bottle neck
<bheads_> another options is your event loop has its own dispatch thread that spins then sleeps when there is no work
<bheads_> I just find it easier to reason about when its the thread that calls loop.run() to be the dispatcher
<andrewrk> but all my worker threads are capable of dispatching
<bheads_> okay so its a pull and not a push dispatcher
<andrewrk> it's a hybrid
<bheads_> I will have to find time to understand this... all my time is sunk into a bathroom remodel and helping my wife get through a major art fair!
<andrewrk> this function dispatches as many coroutines as there are available worker threads
<ofelas> is it safe to assume a codegen bug when things work with release-small but not with release-safe/fast?
<andrewrk> ofelas, not necessarily because there could be undefined behavior. but probably
<andrewrk> does it work in debug mode?
<ofelas> works with "test" if that is debug mode
<andrewrk> bheads_, and then the main worker loop does this: get next coroutine. call dispatch(). resume the coroutine we got. epoll()
<bheads_> each worker needs to call dispatch
<andrewrk> ofelas, test has other modes too - the default is debug, but you can run your tests with --release-small, --release-fast, or --release-safe
<bheads_> I see that now, was this not happening last week?
stratact has quit [Quit: Leaving]
<andrewrk> bheads_, correct. I did this commit yesterday: https://github.com/ziglang/zig/commit/a9ab528e348a3f07dfaffcdcb1031062b1bfe8bb
<ofelas> ok, will try, and release-fast changes behaviour slightly if i sprinkle some warn() here and there
<andrewrk> that's the unfortunate nature of advanced optimizations
<andrewrk> ofelas, if you get stuck I'd be happy to look at your project and try to help
<andrewrk> are you directly porting C code or did you do your implementation sort of from scratch?
<andrewrk> a trick if you're porting, is to run the C code and the Zig code side by side in gdb and inspect state along the way
<ofelas> ok, i'll see if i can wrap my head around this, i ported the deflate part of miniz_oxide to zig, so i've been running c, rust and zig
<bheads_> andrewrk, okay cool. I just went back to my D fiber pool and I see that I did what you did, but the main thread is not a worker in the pool for a differnet reason (its handling a socket based RPC dispatcher and a collection of event timers) so the concept is similar
<andrewrk> ofelas, one thing to consider, make sure you're using wrapping arithmetic where appropriate
<andrewrk> it's possible that the tests are not covering wraparound arithmetic - so you're not getting any panics in testing - but in release modes, with optimizations on, llvm assumes that stuff never wraps and then does incorrect codegen
<ofelas> thanks, i'll see what i can find
<andrewrk> and there are no floats right?
<ofelas> no floats, mostly unsigned with a few i32 and bitCast thrown in
davr0s has joined #zig
<andrewrk> bheads_, what did you do with your D fiber code? what was the application?
jjido has quit [Ping timeout: 255 seconds]
Bas__ has joined #zig
Bas_ has quit [Ping timeout: 252 seconds]
Bas__ has quit [Ping timeout: 252 seconds]
Bas_ has joined #zig
jjido has joined #zig
Bas__ has joined #zig
Bas_ has quit [Ping timeout: 252 seconds]
<Bas__> I was wondering if Zig can take advantage of the asserts when compiling in release-fast
<andrewrk> Bas__, the asserts are communicated to LLVM in the form of conditional branches to unreachable blocks
<andrewrk> so the information is there
<Bas__> Ah cool
<andrewrk> I haven't done a study on how much LLVM is able to take advantage of this information
<Bas__> Cause I had an 'assume' macro in my C++ which was an assert in debug and in release an __assume (visual studio) or __builtin_expect (gcc)
<Bas__> No idea how much it really helped, but I thought it was neat ^^
<andrewrk> yep. zig's unreachable keyword / assert function at least does that
<andrewrk> there's also an open issue to bias branches against errors
<Bas__> yeah cool
<Bas__> It's funny. Many of the things I did for myself and really like are in Zig ^^
<andrewrk> :)
<Bas__> I'm also really happy with integers that don't automagically convert something else.
<andrewrk> unless it's a guaranteed safe conversion that doesn't change mathematical meaning
very-mediocre has quit [Ping timeout: 252 seconds]
<Bas__> yeah, but that's fine.
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
mahmudov has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
zolk3ri has quit [Ping timeout: 260 seconds]
davr0s has joined #zig
zolk3ri has joined #zig
Bas__ has quit [Ping timeout: 252 seconds]
jjido has quit [Ping timeout: 260 seconds]
zolk3ri has quit [Quit: Lost terminal]
jjido has joined #zig
jjido has quit [Remote host closed the connection]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<winksaville> I was playing around with allocators and tried std.heap.c_allocator and when compiling I get error "lld: error: duplicate symbol: _start". I'm guessing I need to link dynamically but don't know how?
<andrewrk> winksaville, did you put `--library c` as a command line parameter?
<winksaville> That did it, txs
geocar has quit [Quit: Connection closed for inactivity]
pancake has quit [Ping timeout: 265 seconds]
edr has quit [Ping timeout: 264 seconds]
<winksaville> andrewrk: in the docs there are a couple examples of build.zig but I don't see how to add "--library c"?
<winksaville> That link went to a "Account recovery page" and it says "you risked getting locked out" I didn't risk getting you or me locked out :)
<andrewrk> in this case I suggest you use private browsing mode
<winksaville> I seems it was on my side, I tried to go to my github page and got the same message so I "comfirmed", fingers crossed I didn't mess something up :)
<winksaville> And I can now use your link, txx
<winksaville> txs
pancake has joined #zig
<winksaville> andrewrk: do you have a simple example build.zig that adds a "clean" target? Right now I execute like this `zig build --cache-dir build/` and then clean using `rm -rf build/`. That works but maybe you have something simpler?
<andrewrk> I don't have a recommended solution for that yet
<winksaville> k, what I've got is good enough for the moment.