ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
<scientes> pub const f64_min = 2.22507385850720138309e-308;
<scientes> pub const f64_min = 2.22507385850720138309e-308;
<scientes> pub const f64_min = 2.22507385850720138309e-308;
<scientes> home/shawn/zig/std/math/index.zig:11:21: error: float literal out of range of any type
<scientes> there we go
<scientes> hmm i see its taken from musl....
<scientes> (this is arm64)
kristate has joined #zig
kristate has quit [Ping timeout: 268 seconds]
kristate has joined #zig
kristate has quit [Remote host closed the connection]
kristate has joined #zig
<kristate> morning
<andrewrk> morning
<scientes> I got a basic CI server going http://git.icu:8010
adrusi has quit [Read error: Connection reset by peer]
<andrewrk> scientes, can you get it working with master branch pushes on github.com/shawnl/zig?
adrusi has joined #zig
<scientes> yean of course, its pull requests that is slightly more complicated
<andrewrk> ah
<scientes> cause you have to use github hooks
<kristate> I find it funny, all of our names are 8 chars in length: andrewrk scientes kristate
dbandstra has joined #zig
<scientes> Can I write a build-in in zig?
<scientes> @mul could be written in zig
<andrewrk> scientes, that's true - there are a few builtins now that could be written in userland
<scientes> the std/index.zig test suite uses too much ram (~1GB) for the buildbot
<scientes> i think there is a leak
<scientes> i'll open a bug
<kristate> andrewrk: scientes: on that note, this is something that I have been meaning to ask, but how is the stage1 compiler managing memory?
<andrewrk> kristate, it treats malloc as one giant arena allocator and never frees
<kristate> andrewrk: haha, I imagined as such
<andrewrk> there are no plans to change this
<kristate> andrewrk: is that how the llvm guys are doing it? I mean, I like this pump and dump idea
<kristate> but like scientes mentions, I get pretty high memory usage on builds
<andrewrk> they're probably using C++ abstractions to manage memory
<kristate> andrewrk: we will be managing on stage2, correct?
<kristate> grep -R "defer" src-self-hosted/ | wc -l #213
<kristate> I see that we have defer in self hosted, so I assume this is correct.
<scientes> to support 32-bit platforms we need to stay under 3GB
<kristate> scientes: well hopefully we can jettison stage1 as fast as possible and get over to self hosted zig
<scientes> yeah that would be awesome
<scientes> *will
<kristate> that is why I am excited about 0.3.0 -- we can get all of the nasty bugs out of the way, and we have a good test case
<kristate> 0.4.0 could be a target to get stage2 out
<kristate> andrewrk has a list here https://github.com/ziglang/zig/projects/2
<andrewrk> kristate, yes, stage2 is a long lived process, so memory is all accounted for
<andrewrk> lots of stuff is reference counted
<kristate> cool beans
<andrewrk> we're stuck with stage1 forever though
<kristate> andrewrk: I'll rebase #1427 because there seems to be a conflict with some of the laster pushes
<kristate> well yeah, but once it is good enough™ we can continue forwards, right?
<andrewrk> right
<andrewrk> there's a point where it becomes significantly less important
<andrewrk> when we start shipping stage3 instead of stage1
<andrewrk> (stage3 is just stage2 built with stage2)
kristate has quit [Remote host closed the connection]
kristate has joined #zig
<dbandstra> if anyone wants to check it out i have a functioning game here https://gitlab.com/dbandstra/oxid
<dbandstra> getting kind of bored of working on it so i guess it's "done" enough
kristate has quit [Remote host closed the connection]
m6w6 has quit [Quit: ZNC - http://znc.in]
<andrewrk> dbandstra, cool!
<andrewrk> dbandstra, mind if I do a "let's play" of it on the stream thursday?
m6w6 has joined #zig
<scientes> i'm getting usr/include/x86_64-linux-gnu/sys/types.h:145:10: note: 'stddef.h' file not found
<scientes> #include <stddef.h>
<scientes> stddef.h is a "special" header, that isn't in /usr/include, like <stdbool.H>
<dbandstra> andrewrk, haha, sure
<scientes> probably should be ignored
kristate has joined #zig
<andrewrk> scientes, stddef.h is provided by zig
<andrewrk> I'm guessing you're not doing `make install` :)
<scientes> ahhhh
<scientes> ok, i'll do it
<andrewrk> did you see the softlink trick that I suggested, if you really want to try to avoid it?
<scientes> yes that is what i'm using
<andrewrk> you'll need to also softlink the c_headers folder to $INSTALL/lib/zig/include
<andrewrk> dbandstra, is zig annoying you in some way that makes you bored, or did you get bored naturally?
<andrewrk> I'm always interested in feedback when someone puts a lot of time into a zig project
kristate has quit [Ping timeout: 272 seconds]
<andrewrk> also I linked your game on https://ziglang.org/
<dbandstra> a little bit of both, with the disclaimer that i only had/have low-quality distraction-filled free time to work on it
<dbandstra> i was having a hard time coming up with useful abstractions/generalized code, especially for the game entity system
<dbandstra> haven't thought anything through enough to come up with a proposal or anything though
kristate has joined #zig
<dbandstra> on the other hand, when it comes to something like the monster's AI, my attention span drops to zero, but i've always been like that :P
<scientes> looks like a bug to llvm-arm64 to me: http://paste.debian.net/1039603/
<scientes> i'll reduce it some more
kristate has quit [Remote host closed the connection]
<dbandstra> another thing i never figured out is how to structure modules/files/capitalization of exported stuff
<dbandstra> if i have a file that just exports a single function it ends up `const someFunc = @import("some_func.zig").someFunc; someFunc();` or maybe `const SomeFunc = @import("some_func.zig"); SomeFunc.run();` ...
<dbandstra> i guess default exports or destructuring imports is "Big Language" stuff
<andrewrk> scientes, I don't know if you saw this, but this may help you: https://gist.github.com/andrewrk/5684434a2a8d4cbb08bb0d855c4f2ada
kristate has joined #zig
kristate has quit [Ping timeout: 272 seconds]
<dbandstra> i would like to keep going with another game but figure out how to share/abstract as much code as possible from this one
<dbandstra> (within reason)
<scientes> will zig build against llvm 7?
<scientes> or i guess that just means master my bad
tiehuis has joined #zig
benaiah has quit [Remote host closed the connection]
benaiah has joined #zig
tiehuis has quit [Quit: WeeChat 2.2]
hoppetosse has quit [Ping timeout: 268 seconds]
kristate has joined #zig
kristate has quit [Remote host closed the connection]
<andrewrk> scientes: I ran the full zig test suite against llvm 7.0.0rc2 with assertions enabled two days ago and everything passed
<andrewrk> This is in the llvm7 branch
<andrewrk> I will merge this branch into master the same day llvm 7 is released and then release zig 0.3.0 one week later
kristate has joined #zig
<kristate> dbandstra: cool game!
dbandstra has quit [Quit: Leaving]
<kristate> andrewrk: hey, I am trying to access a external c function accepting a **struct
<kristate> how should I define that function and how should I access it?
allan0 has joined #zig
<kristate> translate-c translates static void testtest(struct bob **b) {} as pub fn testtest(b: ?[*](?*struct_bob)) void {}
<kristate> and struct bob; as pub const struct_bob = @OpaqueType();
<kristate> andrewrk: is translate-c outputting old code? do we need to update it?
kristate has quit [Remote host closed the connection]
kristate has joined #zig
davr0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kristate 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
kristate has joined #zig
kristate has quit [Ping timeout: 272 seconds]
kristate has joined #zig
kristate has quit [Remote host closed the connection]
kristate has joined #zig
kristate has quit [Ping timeout: 264 seconds]
qazo has joined #zig
return0xe has quit [Remote host closed the connection]
return0xe has joined #zig
kristate has joined #zig
return0xe has quit [Remote host closed the connection]
return0xe has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
return0xe has quit [Remote host closed the connection]
return0e has joined #zig
noonien has joined #zig
hooo has joined #zig
<hooo> hi, I did this but get an error: "zig translate-c /usr/include/GraphicsMagick/magick/image.h" error: 'magick/forward.h' file not found
<hooo> how do I specify the include folder?
<scientes> -i
davr0s has joined #zig
<hooo> scientes: I meant obviously for translate-c
<hooo> how am I supposed to use this functionality?
<hooo> ok it's -isystem
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hoppetosse has joined #zig
kristate has quit [Remote host closed the connection]
kristate has joined #zig
<scientes> thats what i meant
davr0s has joined #zig
<hoppetosse> andrewrk: it seems I forgot about function pointers implicitly casting to *c_void
kristate has quit [Ping timeout: 272 seconds]
wryun has quit [Quit: wryun]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
SimonNa has joined #zig
qazo has quit [Ping timeout: 244 seconds]
Ichorio has joined #zig
kristate has joined #zig
bheads has quit [Ping timeout: 244 seconds]
davr0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
redj has quit [Quit: No Ping reply in 180 seconds.]
qazo has joined #zig
qazo has quit [Ping timeout: 244 seconds]
kristate has quit [Remote host closed the connection]
<andrewrk> hoppetosse, should be pretty easy to add
<hoppetosse> yeah, almost done
<hoppetosse> I'll send a pr after dinner
hoppetosse has quit [Ping timeout: 244 seconds]
kristate has joined #zig
Ichorio has quit [Ping timeout: 244 seconds]
Ichorio has joined #zig
m6w6 has quit [*.net *.split]
m6w6 has joined #zig
Ichorio has quit [Ping timeout: 272 seconds]
<andrewrk> hoo, I think I fixed one of the nastiest comptime bugs
<andrewrk> hooo, sorry that wasn't meant to address you, that was an expression
davr0s has joined #zig
hoppetosse has joined #zig
<andrewrk> wow, yep. just pushed a commit that fixes 4 bugs
<andrewrk> MajorLag, I think you've been waiting for this commit for a long time
wryun has joined #zig
kristate has quit [Remote host closed the connection]
kristate has joined #zig
m6w6 has quit [Ping timeout: 264 seconds]
m6w6 has joined #zig
kristate has quit [Ping timeout: 252 seconds]
wryun has quit [Quit: wryun]
<MajorLag> Indeed. I got so used to working around it I'd forgotten about it. I wonder how much code I could simplify now. Thanks for fixing it.
<andrewrk> and now I got my issue quota done for today so I'm going to work on windows stack traces
<MajorLag> oh boy, that'd be early christmas.
noonien has quit [Quit: Connection closed for inactivity]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mnoronha has joined #zig
kristate has joined #zig
adrusi has quit [Ping timeout: 252 seconds]
adrusi has joined #zig
kristate_ has joined #zig
kristate has quit [Ping timeout: 264 seconds]
kristate has joined #zig
kristate_ has quit [Ping timeout: 264 seconds]
davr0s has joined #zig
<kristate> andrewrk: hey, are you online?
<andrewrk> kristate, yep
<kristate> can we talk about #1403
<kristate> josh said he hasn't checked my code, yet it has been rejected
<andrewrk> yeah let's talk
<kristate> this has nothing to do with goto
<andrewrk> what do you think about josh's point at the end, with the code example?
<kristate> is there an example that is more fleshed out so that I can test it on the branch?
<kristate> I have no problems with writing code and talking about the points -- josh is bringing important points,
<kristate> I don't like the fact that after josh posts that it gets auto rejected, then I have to reopen and all sorts of activity takes place
<andrewrk> the thing he's talking about with a check for referencing a variable is here: https://github.com/ziglang/zig/pull/1427/files#diff-476daa305f4d991c0f097fc22a1c7ad6R12984
<kristate> Yes
<andrewrk> there's no such thing as auto rejection - it's just me making a decision
<andrewrk> which becomes the new status quo
<andrewrk> and I respect you which is why I am willing to reconsider status quo
<andrewrk> but it puts the ball in your court
<andrewrk> I do feel bad though, I think you could save a lot of effort by waiting to write a working PR until something is officially accepted
<kristate> I just want to write safe yet effective code, and your proposal makes lots of sense
<kristate> there was a case that josh brought, which I thought was valid and important
<andrewrk> before josh said anything, I was already uncomfortable with the if (!var->value->type) code
<kristate> but by informing the programmer that they are doing something that is not doable, then everything works out
<andrewrk> just like your PR https://github.com/ziglang/zig/pull/1426, it makes something that previously was supposed to never be null, allowed to be null. which shouldn't just be done without considering the consequences
<andrewrk> in the above example it would have hidden the root cause problem
<kristate> I agree with #1426
<kristate> and I was glad that to see the patch that followed.
<andrewrk> can you interact with josh on the issue? I'll re-open it
<andrewrk> as of this moment reading the discussion I am convinced by josh's arguments, but maybe if you continue the conversation that would change
<andrewrk> and I really am sorry about rejecting your working code. it feels awful to do that
<kristate> josh's next question is something that I wonder too: "can you jump to a continue expression before a variable is declared as long as the variable is not used in the continue expression as determined by comptime analysis"
<kristate> how do we write that up and test it so that I can run it on the branch>
<kristate> ?
<andrewrk> let me come up with some examples
<kristate> andrewrk: it's working?
<kristate> let me post what I have
<andrewrk> kristate, I'm waiting for my mac to install updates, it says 17 minutes left. sorry for the delay
<kristate> andrewrk: I think that josh is confused about the order in which the continue expression is executed
<andrewrk> I have some more examples I want to try
<kristate> the scope that we plug into the continue expr comes from the while body
<kristate> the decl of handle comes before the continue expr
<kristate> if handle is not available in all branches, then we return an error, which prompts the programmer to re-think their flow
<kristate> this is a _good_ feature to have
<andrewrk> just a minute, working on a couple more examples
<kristate> cool
<andrewrk> kristate, updated
<kristate> let me check it out
<andrewrk> I used your branch for these examples
<kristate> the last one is causing an inf loop?
<andrewrk> yes - the continue jumps to the continue expression before x is declared and initialized
<andrewrk> the line of code I linked to earlier that I mentioned I was uncomfortable with, is not a sound way to accomplish the goal
mnoronha has quit [Ping timeout: 252 seconds]
<kristate> andrewrk: but this is correct code, is it not?
<andrewrk> I don't understand the question
<kristate> was it supposed to not loop?
<andrewrk> do you understand that it is invoking undefined behavior?
<kristate> how is it undefined? the way that continue expr is implemented in the compiler, this is all fine
<kristate> in fact, it is doing the same thing, regardless of my code
<andrewrk> what value do you think x is the first time the expression i += x is evaluated?
<kristate> all my code does is give the return scope from the while body to the continue expression
<andrewrk> I feel like the fact that it is not clear to you what is happening is evidence that it is too complicated
<kristate> hmm, if we change var runtime_true = true; to const runtime_true = true;
<kristate> we get the reference
<kristate> cannot reference variable from unreachable code region
<kristate> andrewrk: I think there maybe something more sinister happening
<kristate> let me work on your test case -- it should be returning an error
<kristate> the fact that zig isn't catching that is frightening. I am guessing that it is initing to 0 in the case of var
<kristate> might be interesting to print out x
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<kristate> andrewrk: yeah, just tried to print it out and its 0
<andrewrk> that's uninitialized memory
<kristate> yeah, but why isn't zig throwing an error?
<andrewrk> zig does catch that. if you run master branch zig on this example it's a compile error
<kristate> no no, that is only because of a scope difference
<andrewrk> scopes is how zig figures out if variables are declared or not
<andrewrk> each variable declaration starts a new scope
<kristate> hmm, let me play with it for 24 hours and if I can't do something about this, we can reject
<andrewrk> sounds good, let's revisit in 24 hours
<kristate> I am worried that down the line another problem may pop up
<kristate> I also want to understand scopes more
<kristate> okay, need to catch a bullet train to tokyo
<kristate> brb
kristate has quit [Ping timeout: 252 seconds]
fsateler has joined #zig
shodan45 has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
wink_ has quit [Remote host closed the connection]
hooo has quit [Ping timeout: 252 seconds]
return0e has quit [Read error: Connection reset by peer]
return0e has joined #zig
darithorn has joined #zig