ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
mahmudov has joined #zig
kristate has joined #zig
kristate has quit [Remote host closed the connection]
kristate has joined #zig
donlzx has joined #zig
kristate has quit [Ping timeout: 268 seconds]
<GitHub19> [zig] winksaville opened pull request #1254: Add swapRemoveOrError (master...add-swapRemoveOrError) https://git.io/fN3nB
<GitHub7> [zig] andrewrk pushed 1 new commit to master: https://git.io/fN3cl
<GitHub7> zig/master 97bfeac Andrew Kelley: self-hosted: create tmp dir for .o files and emit .o file for fn
zolk3ri has quit [Remote host closed the connection]
kristate has joined #zig
kristate has quit [Remote host closed the connection]
donlzx has quit [Remote host closed the connection]
kristate has joined #zig
kristate has quit [Remote host closed the connection]
v1zix has joined #zig
``` has joined #zig
``` has quit [Ping timeout: 252 seconds]
very-mediocre has joined #zig
kristate has joined #zig
<GitHub7> [zig] andrewrk pushed 1 new commit to master: https://git.io/fN3Bd
<GitHub7> zig/master 3bb00ea Andrew Kelley: self-hosted: implement getAppDataDir for windows
v1zix has quit [Ping timeout: 252 seconds]
dbandstra has joined #zig
darithorn has quit [Quit: Leaving]
darithorn has joined #zig
donlzx has joined #zig
darithorn has quit [Remote host closed the connection]
xtreak has joined #zig
mahmudov has quit [Remote host closed the connection]
<dbandstra> why is it not possible to compare `?T` to `T`? i saw the issue that was resolved a couple days ago but it was only for pointers
<dbandstra> if it compiles down to two comparisons i don't see why that's a problem
<dbandstra> my example: `if (if (transparent_color_index) |t| t == index else false) {` (thanks to thejoshwolfe for the crazy if-in-if idea)
<dbandstra> i'm not sure if there was an argument against it (the non-pointer case) or if it kind of got missed
<dbandstra> `if ((transparent_color_index orelse ~index) == index)` is cuter for my situation ... forgot about this operator. but this wouldn't work for e.g. floats
hio has joined #zig
kristate has quit [Remote host closed the connection]
kristate has joined #zig
v1zix has joined #zig
jjido has joined #zig
kristate has quit [Remote host closed the connection]
hio has quit []
kristate has joined #zig
donlzx has quit [Remote host closed the connection]
v1zix has quit [Ping timeout: 252 seconds]
jjido has quit [Ping timeout: 244 seconds]
unique_id has joined #zig
dbandstra has quit [Quit: Leaving]
ffnode has joined #zig
jjido has joined #zig
jjido has quit [Read error: Connection reset by peer]
jjido has joined #zig
<GitHub191> [zig] kristate opened pull request #1255: Revert removal of IR dead code (master...issue1249) https://git.io/fN3aF
jjido has quit [Ping timeout: 240 seconds]
kristate has quit [Remote host closed the connection]
kristate has joined #zig
kristate has quit [Remote host closed the connection]
kristate has joined #zig
Avinash has joined #zig
Avinash_ has joined #zig
kristate has quit [Remote host closed the connection]
kristate has joined #zig
Avinash has quit [Ping timeout: 264 seconds]
lmb_ has joined #zig
<lmb_> hello, i just started noodling around with zig, and have a question re "comptime return types". i have a fn (comptime a, comptime data: []const u8) []const u8. if i try to assign the result of that to a comptime const I get a compiler error. am I missing something or is this not supported by zig?
Avinash_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xtreak has quit [Remote host closed the connection]
donlzx has joined #zig
davr0s has joined #zig
tiehuis has joined #zig
<tiehuis> lmb_: that should be fine, could you post the full example?
<tiehuis> the compile-time evaluation part of zig usually has the largest share of bugs so it is possible that there is could be an issue there
<tiehuis> also, i've pushed a wrapper library over SDL2 that I had lying around here: https://github.com/tiehuis/zig-sdl2
Avinash has joined #zig
<tiehuis> main intention here is to better convery single-item pointer types, nullable types and untranslatable macros
<tiehuis> it's a fairly quick pass so there are probably issues but feel free to make any prs
<tiehuis> @cImport works pretty well as is for small examples right now, so it isn't that required, but it may be helpful if you want to be more heavily dependent
<lmb_> @tiehuis: it goes roughly like this https://gist.github.com/lmb/f5444ac96b7e3d0ab860682315cad5f4
<lmb_> the idea is to build testcases for a parser at compile time
<tiehuis> can you try `const data = comptime makeToken` instead of `comptime const data = makeToken`
xtreak has joined #zig
<lmb_> yup
<tiehuis> that work okay?
<lmb_> yeah, it compiles!
<lmb_> cheers
<lmb_> comptime errors could use some love, but then i'm guessing there is an issue for that already :D
<tiehuis> awesome! i don't know the reason why that first one doesn't work at the momemnt but generally putting comptime on the function call is preferable
<tiehuis> to needing it on a const
<lmb_> ok
<tiehuis> you shouldn't ever need it on a const decl as far as i can think
<lmb_> it wasn't entirely clear at which points i can slap it
<lmb_> so i just put it in a few places where it seemed reasonable
<tiehuis> i believe that initial wya doesn't work because it won't execute makeToken at comptime by default and
<tiehuis> comptime on the left side doesn't act as a single block like one may otherwise expect
<tiehuis> e.g. `comptime { const data = makeToken(...); }`
<lmb_> i kind of expected the compiler to implicitly make the return value of makeToken comptime
<lmb_> ah
<lmb_> so `comptime makeToken` is just a comptime block with a single statement in it?
<tiehuis> yeah, i think thats doable, and the compiler should try to execute the rhs at comptime whenever the lhs is explicitly comptime
<tiehuis> you can think of it like that probably, yeah
<lmb_> ok, thanks for the help
<lmb_> coming from a Go background, zig is pretty easy to pick up
<lmb_> and so far its fun
<lmb_> so thanks for working on it!
<tiehuis> no problem
<tiehuis> that's good to hear! feel free to ask any more questions if any other issues come up
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
zolk3ri has joined #zig
hooo has joined #zig
Avinash has quit [Quit: Textual IRC Client: www.textualapp.com]
davr0s has joined #zig
ffnode has quit [Ping timeout: 252 seconds]
tiehuis has quit [Quit: WeeChat 2.2]
<unique_id> well, I'm having some eye strain issues atm. That means limiting computer use to programming only. Signing out.
unique_id has left #zig ["Konversation terminated!"]
lmb_ has quit [Quit: Page closed]
kristate has quit [Ping timeout: 256 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jjido has joined #zig
donlzx has quit [Remote host closed the connection]
donlzx has joined #zig
donlzx has quit [Remote host closed the connection]
ffnode has joined #zig
davr0s has joined #zig
Richard10 has joined #zig
Richard10 has quit [Client Quit]
xtreak has quit [Remote host closed the connection]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
Ichorio has joined #zig
very-mediocre has quit [Ping timeout: 252 seconds]
<andrewrk> dbandstra, I could answer the question for more specific cases - but for example we already don't support == for structs, so if the optional type had a struct as a child type, that wouldn't work
<GitHub97> [zig] andrewrk closed pull request #1255: Revert removal of IR dead code (master...issue1249) https://git.io/fN3aF
<GitHub116> [zig] andrewrk pushed 1 new commit to master: https://git.io/fNsqr
<GitHub116> zig/master 69e3b4e kristopher tate: revert commit 860d3da9156a0b1f4a1e3e644b423da3e768bb86 ; please see #1249 for more information; (#1255)
<GitHub15> [zig] andrewrk closed pull request #1253: Give ArrayList tests consistent names (master...give-std.ArrayList-tests-consistent-names) https://git.io/fN3Or
<GitHub128> [zig] andrewrk pushed 1 new commit to master: https://git.io/fNsqP
<GitHub128> zig/master d1a6024 Wink Saville: Give ArrayList tests consistent names (#1253)...
<GitHub129> [zig] andrewrk closed pull request #1254: Add swapRemoveOrError (master...add-swapRemoveOrError) https://git.io/fN3nB
<GitHub178> [zig] andrewrk pushed 1 new commit to master: https://git.io/fNsqd
<GitHub178> zig/master 3cbf59b Wink Saville: Add swapRemoveOrError (#1254)...
Ichorio has quit [Read error: Connection reset by peer]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<GitHub43> [zig] andrewrk pushed 1 new commit to master: https://git.io/fNsYD
<GitHub43> zig/master 1a7cf4c Andrew Kelley: port 69e3b4e to self-hosted compiler...
hooo has quit [Quit: Page closed]
Tobba has quit [Remote host closed the connection]
Tobba has joined #zig
davr0s has joined #zig
ffnode has quit [Ping timeout: 252 seconds]
darithorn has joined #zig
BenJGirard has joined #zig
BenJGirard has quit [Client Quit]
jjido has quit [Read error: Connection reset by peer]
bheads_ has joined #zig
bheads__ has quit [Ping timeout: 244 seconds]
jjido has joined #zig
bheads__ has joined #zig
jjido has quit [Ping timeout: 240 seconds]
bheads_ has quit [Ping timeout: 240 seconds]
jjido has joined #zig
lmb has joined #zig
<lmb> just wondering, is this a known bug? https://gist.github.com/lmb/cc1f03437b78be4be65543c7ba57875c
<lmb> changing var to type in the function signature makes it go away
<GitHub153> [zig] andrewrk pushed 1 new commit to master: https://git.io/fNsu6
<GitHub153> zig/master ecf8da0 Andrew Kelley: self-hosted: linking
Bas_ has joined #zig
darithorn has quit [Quit: Leaving]
Ichorio has joined #zig
stratact has quit [Quit: Leaving]
jjido has quit [Ping timeout: 256 seconds]
MajorLag1 has quit [Ping timeout: 240 seconds]
MajorLag1 has joined #zig
<GitHub66> [zig] andrewrk pushed 1 new commit to master: https://git.io/fNsPl
<GitHub66> zig/master a9ab528 Andrew Kelley: std.event.Loop.onNextTick dispatches work to waiting threads
<lmb> ok, thanks
<wilsonk> any idea why doing 'zig build' with a pretty much empty build.zig file (just a dummy build function) gives a ton of 'duplicate struct field' errors?
<wilsonk> zig-cache has all the builtin code copied into it and that is the source of all the duplicate fields?
<andrewrk> wilsonk, I'd be happy to help. can you paste the file somewhere and link it?
<andrewrk> I tried just now to reproduce the issue unsuccessfully
<wilsonk> strange...there is really nothing to it https://paste.ofcode.org/RjXHacxuBmaRbfWkdBtZbD
<wilsonk> am I not supposed to pass in the Builder?
<andrewrk> /home/andy/tmp/build.zig:1:18: error: use of undeclared identifier 'Builder'
<andrewrk> that's what I get. are you using a master build? you're using the old pointer syntax
<wilsonk> yeah, I just saw that and changed it
<wilsonk> weird that I don't get the undeclared identifier error
<wilsonk> ah, nvm...I see what I did
<andrewrk> what was it?
<wilsonk> just wasn't using '--build-file'
<andrewrk> so it was looking at build.zig in the current working directory
<wilsonk> yes
<wilsonk> so it seems like 'zig build' fails even with a build.zig file in the cwd but 'zig build --build-file build.zig' doesn't produce any errors about duplicate symbols? (I just pulled the newest repo and built one minute ago, btw)
Tobba has quit [Read error: Connection reset by peer]
<andrewrk> I'd be happy to help if you provide a paste
tobbez has quit [Ping timeout: 245 seconds]
<wilsonk> Oh, that is fine...it is working now if I just supply the --build-file arg. No problems
<andrewrk> that's not a known issue and I'm unable to reproduce it
<wilsonk> whoa, weird...now it is working with just the regular 'zig build' command? Not sure what happened before...it was trying to include 'builtin' twice or something? Weird
Bas_ has quit [Ping timeout: 252 seconds]
<wilsonk> what does the ?? operator do? Test an optional for null?
<andrewrk> there is no ?? operator
<wilsonk> oh, there used to be one...yes? Was it changed to something else?
<andrewrk> yes, it changed to the `orelse` keyword
<wilsonk> ok, cool
tobbez has joined #zig
bheads_ has joined #zig
tankf33der has joined #zig
bheads__ has quit [Ping timeout: 248 seconds]
bheads__ has joined #zig
bheads_ has quit [Ping timeout: 260 seconds]
Ichorio has quit [Ping timeout: 256 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lmb has quit [Quit: Page closed]
Tobba has joined #zig
<wilsonk> can you index a pointer in Zig? Like pointer[2] = 0xFF...the compiler says 'index of single-item pointer'?
<andrewrk> wilsonk, yes you can - you need to obtain an unknown length pointer
<andrewrk> if you show me some code I can suggest how to modify it
<wilsonk> 'const p = @intToPtr(*usiz, fn()); p[2] = otherUsiz;' ... something like that.
<andrewrk> do this: const p = @intToPtr([*]usize, fn());
<andrewrk> *usize means "there is exactly 1 item at this address"
<andrewrk> [*]usize means "there are an unknown number of items in a row at this address"
<wilsonk> ah, ok. Nice
donlzx has joined #zig