ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
ryanmtate has quit [Remote host closed the connection]
kristate has joined #zig
kristate has quit [Ping timeout: 252 seconds]
kristate has joined #zig
moxotter has joined #zig
<moxotter>
Hi!
mnoronha has quit [Ping timeout: 272 seconds]
<andrewrk>
hi moxotter
<kristate>
hi moxotter
<kristate>
scientes: hey, let me get that code up re: networking. it has been a busy week for me and I haven't gotten a chance to push the code
<kristate>
DutchGh0s: you are not getting any sort of assert error on your build of zig?
<kristate>
DutchGh0s: I don't think we have the logic inside of the compiler right now to do that sort of transformation in comptime -- but maybe you could use a builtin intrinsic
<DutchGh0s>
error: expected type '*thingy', found '*const thingy'
<DutchGh0s>
var ptr = item.as_mut();
<kristate>
DutchGh0s: is that with repro ?
<kristate>
On my build, I don't get an error :-)
<kristate>
rather, I get a nasty assert, but the error is different
<DutchGh0s>
yes, with repro
<kristate>
DutchGh0s: what are you trying to accomplish?
<DutchGh0s>
invent some kind of 'Trait' system, but without allocation and fully checked at comptime
<kristate>
DutchGh0s: hmm, might be better to do these sort of things inside of the compiler
<DutchGh0s>
but Im not a compiler hacker xD
<DutchGh0s>
and maybe there are people who not like it
<kristate>
DutchGh0s: it's not too hard :-) the world needs more compiler hackers
<kristate>
DutchGh0s: you can learn a lot by looking at pull requests
wryun has joined #zig
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 272 seconds]
<DutchGh0s>
how do I unwrap a nullable
<DutchGh0s>
oh, .?
<DutchGh0s>
but how do I unwrap, or if null, return null ?
<DutchGh0s>
that used to be 'something ?? return null'
<scientes>
if (maybe_something) |something| { } else return null
<kristate>
if (abc) |a| { //do something with `a` }
<andrewrk>
kristate, here's the steps to fix it: 1. start with DutchGh0s big file and reproduce it. 2. delete stuff from it until you have a minimal test case 3. fix the root cause, which is causing the value to be null 4. add test case to test/behavior.zig
<andrewrk>
no worries if that's too much work, I'll take it on
DutchGh0st has joined #zig
<kristate>
andrewrk: yes, I agree with you -- but it is hard to get your head around :-)
<kristate>
what to cut
<kristate>
andrewrk: if you can take care of it, that would be great
<kristate>
I am working on #1223
<DutchGh0st>
Ill try and reduce
<DutchGh0st>
if that helps
<andrewrk>
DutchGh0st, that would help a lot. if you can't do that, that's ok too, I would accept a bug report with your big test case too
<kristate>
DutchGh0st: andrewrk that would be hard for you/him
<kristate>
andrewrk: he is on windows and doesn't have a master build
<DutchGh0st>
I could download the latest succedfull build
<DutchGh0st>
and I have the 2.0 build
<DutchGh0st>
I can at least try and reduce the Zig source :)
<andrewrk>
I'm going to do social activities today, might be around later
<andrewrk>
bye
<wink_>
I tried to compile examples/hello_libc.zig and had to make some changes to do so. I had to remove the parameters, change return to u8 and return a positive value. Want me to create a PR or is it supposed to work as it and I've done something wrong?
ryanmtate has joined #zig
rohlem has quit []
<DutchGh0st>
okey I got it to a minimal repro
<kristate>
DutchGh0st: cool -- post it for me please
<DutchGh0st>
but when removing a comptime block, it doesnt compile
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kristate has joined #zig
mnoronha has joined #zig
kristate has quit [Ping timeout: 272 seconds]
mnoronha has quit [Ping timeout: 272 seconds]
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 252 seconds]
mnoronha has joined #zig
reductum has quit [Quit: WeeChat 2.2]
davr0s has joined #zig
darithorn_ has joined #zig
darithorn has quit [Ping timeout: 276 seconds]
darithorn_ has quit [Client Quit]
<wink_>
I found my problem compiling hello_libc.zig, I needed to compile using --library c like so: "$ zig build-exe --library c example/hello_world/hello_libc.zig".