00:18
<
scientes >
pub const f64_min = 2.22507385850720138309e-308;
00:18
<
scientes >
pub const f64_min = 2.22507385850720138309e-308;
00:18
<
scientes >
pub const f64_min = 2.22507385850720138309e-308;
00:18
<
scientes >
home/shawn/zig/std/math/index.zig:11:21: error: float literal out of range of any type
00:18
<
scientes >
there we go
00:21
<
scientes >
hmm i see its taken from musl....
00:22
<
scientes >
(this is arm64)
01:34
kristate has joined #zig
01:39
kristate has quit [Ping timeout: 268 seconds]
01:54
kristate has joined #zig
01:56
kristate has quit [Remote host closed the connection]
01:56
kristate has joined #zig
02:08
adrusi has quit [Read error: Connection reset by peer]
02:10
<
andrewrk >
scientes, can you get it working with master branch pushes on github.com/shawnl/zig?
02:11
adrusi has joined #zig
02:11
<
scientes >
yean of course, its pull requests that is slightly more complicated
02:12
<
scientes >
cause you have to use github hooks
02:29
<
kristate >
I find it funny, all of our names are 8 chars in length: andrewrk scientes kristate
02:36
dbandstra has joined #zig
02:52
<
scientes >
Can I write a build-in in zig?
02:52
<
scientes >
@mul could be written in zig
03:02
<
andrewrk >
scientes, that's true - there are a few builtins now that could be written in userland
03:06
<
scientes >
the std/index.zig test suite uses too much ram (~1GB) for the buildbot
03:06
<
scientes >
i think there is a leak
03:07
<
scientes >
i'll open a bug
03:08
<
kristate >
andrewrk: scientes: on that note, this is something that I have been meaning to ask, but how is the stage1 compiler managing memory?
03:09
<
andrewrk >
kristate, it treats malloc as one giant arena allocator and never frees
03:09
<
kristate >
andrewrk: haha, I imagined as such
03:09
<
andrewrk >
there are no plans to change this
03:10
<
kristate >
andrewrk: is that how the llvm guys are doing it? I mean, I like this pump and dump idea
03:10
<
kristate >
but like scientes mentions, I get pretty high memory usage on builds
03:10
<
andrewrk >
they're probably using C++ abstractions to manage memory
03:11
<
kristate >
andrewrk: we will be managing on stage2, correct?
03:12
<
kristate >
grep -R "defer" src-self-hosted/ | wc -l #213
03:12
<
kristate >
I see that we have defer in self hosted, so I assume this is correct.
03:14
<
scientes >
to support 32-bit platforms we need to stay under 3GB
03:15
<
kristate >
scientes: well hopefully we can jettison stage1 as fast as possible and get over to self hosted zig
03:16
<
scientes >
yeah that would be awesome
03:16
<
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
03:17
<
kristate >
0.4.0 could be a target to get stage2 out
03:18
<
andrewrk >
kristate, yes, stage2 is a long lived process, so memory is all accounted for
03:18
<
andrewrk >
lots of stuff is reference counted
03:19
<
kristate >
cool beans
03:20
<
andrewrk >
we're stuck with stage1 forever though
03:20
<
kristate >
andrewrk: I'll rebase #1427 because there seems to be a conflict with some of the laster pushes
03:21
<
kristate >
well yeah, but once it is good enough™ we can continue forwards, right?
03:24
<
andrewrk >
there's a point where it becomes significantly less important
03:24
<
andrewrk >
when we start shipping stage3 instead of stage1
03:25
<
andrewrk >
(stage3 is just stage2 built with stage2)
03:46
kristate has quit [Remote host closed the connection]
03:52
kristate has joined #zig
04:08
<
dbandstra >
getting kind of bored of working on it so i guess it's "done" enough
04:08
kristate has quit [Remote host closed the connection]
04:28
<
andrewrk >
dbandstra, cool!
04:29
<
andrewrk >
dbandstra, mind if I do a "let's play" of it on the stream thursday?
04:32
m6w6 has joined #zig
04:32
<
scientes >
i'm getting usr/include/x86_64-linux-gnu/sys/types.h:145:10: note: 'stddef.h' file not found
04:32
<
scientes >
#include <stddef.h>
04:33
<
scientes >
stddef.h is a "special" header, that isn't in /usr/include, like <stdbool.H>
04:33
<
dbandstra >
andrewrk, haha, sure
04:33
<
scientes >
probably should be ignored
04:37
kristate has joined #zig
04:37
<
andrewrk >
scientes, stddef.h is provided by zig
04:37
<
andrewrk >
I'm guessing you're not doing `make install` :)
04:38
<
scientes >
ok, i'll do it
04:38
<
andrewrk >
did you see the softlink trick that I suggested, if you really want to try to avoid it?
04:38
<
scientes >
yes that is what i'm using
04:39
<
andrewrk >
you'll need to also softlink the c_headers folder to $INSTALL/lib/zig/include
04:40
<
andrewrk >
dbandstra, is zig annoying you in some way that makes you bored, or did you get bored naturally?
04:40
<
andrewrk >
I'm always interested in feedback when someone puts a lot of time into a zig project
04:42
kristate has quit [Ping timeout: 272 seconds]
04:44
<
dbandstra >
a little bit of both, with the disclaimer that i only had/have low-quality distraction-filled free time to work on it
04:45
<
dbandstra >
i was having a hard time coming up with useful abstractions/generalized code, especially for the game entity system
04:48
<
dbandstra >
haven't thought anything through enough to come up with a proposal or anything though
04:48
kristate has joined #zig
04:49
<
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
04:51
<
scientes >
i'll reduce it some more
04:54
kristate has quit [Remote host closed the connection]
04:55
<
dbandstra >
another thing i never figured out is how to structure modules/files/capitalization of exported stuff
04:56
<
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();` ...
04:58
<
dbandstra >
i guess default exports or destructuring imports is "Big Language" stuff
05:03
kristate has joined #zig
05:08
kristate has quit [Ping timeout: 272 seconds]
05:13
<
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
05:13
<
dbandstra >
(within reason)
05:25
<
scientes >
will zig build against llvm 7?
05:26
<
scientes >
or i guess that just means master my bad
05:39
tiehuis has joined #zig
05:54
benaiah has quit [Remote host closed the connection]
05:54
benaiah has joined #zig
06:13
tiehuis has quit [Quit: WeeChat 2.2]
06:52
hoppetosse has quit [Ping timeout: 268 seconds]
06:53
kristate has joined #zig
06:57
kristate has quit [Remote host closed the connection]
07:22
<
andrewrk >
scientes: I ran the full zig test suite against llvm 7.0.0rc2 with assertions enabled two days ago and everything passed
07:22
<
andrewrk >
This is in the llvm7 branch
07:23
<
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
07:26
kristate has joined #zig
07:34
<
kristate >
dbandstra: cool game!
07:38
dbandstra has quit [Quit: Leaving]
07:53
<
kristate >
andrewrk: hey, I am trying to access a external c function accepting a **struct
07:53
<
kristate >
how should I define that function and how should I access it?
07:54
allan0 has joined #zig
07:56
<
kristate >
translate-c translates static void testtest(struct bob **b) {} as pub fn testtest(b: ?[*](?*struct_bob)) void {}
07:57
<
kristate >
and struct bob; as pub const struct_bob = @OpaqueType();
08:14
<
kristate >
andrewrk: is translate-c outputting old code? do we need to update it?
08:27
kristate has quit [Remote host closed the connection]
08:29
kristate has joined #zig
08:38
davr0s has joined #zig
08:38
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
08:40
kristate has quit [Remote host closed the connection]
09:32
davr0s has joined #zig
10:33
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
10:37
davr0s has joined #zig
10:40
kristate has joined #zig
10:45
kristate has quit [Ping timeout: 272 seconds]
11:02
kristate has joined #zig
11:15
kristate has quit [Remote host closed the connection]
11:17
kristate has joined #zig
11:22
kristate has quit [Ping timeout: 264 seconds]
12:21
qazo has joined #zig
12:23
return0xe has quit [Remote host closed the connection]
12:24
return0xe has joined #zig
12:24
kristate has joined #zig
12:39
return0xe has quit [Remote host closed the connection]
12:39
return0xe has joined #zig
12:46
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
12:47
return0xe has quit [Remote host closed the connection]
12:48
return0e has joined #zig
13:03
noonien has joined #zig
13:08
hooo has joined #zig
13:09
<
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
13:09
<
hooo >
how do I specify the include folder?
13:16
davr0s has joined #zig
13:17
<
hooo >
scientes: I meant obviously for translate-c
13:17
<
hooo >
how am I supposed to use this functionality?
13:24
<
hooo >
ok it's -isystem
13:24
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
13:24
hoppetosse has joined #zig
13:29
kristate has quit [Remote host closed the connection]
13:30
kristate has joined #zig
13:33
<
scientes >
thats what i meant
13:33
davr0s has joined #zig
13:35
<
hoppetosse >
andrewrk: it seems I forgot about function pointers implicitly casting to *c_void
13:35
kristate has quit [Ping timeout: 272 seconds]
13:59
wryun has quit [Quit: wryun]
14:02
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
15:04
SimonNa has joined #zig
15:04
qazo has quit [Ping timeout: 244 seconds]
15:08
Ichorio has joined #zig
15:22
kristate has joined #zig
15:25
bheads has quit [Ping timeout: 244 seconds]
15:39
davr0s has joined #zig
16:16
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
16:26
redj has quit [Quit: No Ping reply in 180 seconds.]
16:56
qazo has joined #zig
17:02
qazo has quit [Ping timeout: 244 seconds]
17:07
kristate has quit [Remote host closed the connection]
17:15
<
andrewrk >
hoppetosse, should be pretty easy to add
17:16
<
hoppetosse >
yeah, almost done
17:16
<
hoppetosse >
I'll send a pr after dinner
17:37
hoppetosse has quit [Ping timeout: 244 seconds]
17:47
kristate has joined #zig
17:54
Ichorio has quit [Ping timeout: 244 seconds]
18:32
Ichorio has joined #zig
18:33
m6w6 has quit [*.net *.split]
18:33
m6w6 has joined #zig
18:48
Ichorio has quit [Ping timeout: 272 seconds]
19:14
<
andrewrk >
hoo, I think I fixed one of the nastiest comptime bugs
19:15
<
andrewrk >
hooo, sorry that wasn't meant to address you, that was an expression
19:18
davr0s has joined #zig
19:23
hoppetosse has joined #zig
19:26
<
andrewrk >
wow, yep. just pushed a commit that fixes 4 bugs
19:27
<
andrewrk >
MajorLag, I think you've been waiting for this commit for a long time
19:29
wryun has joined #zig
19:33
kristate has quit [Remote host closed the connection]
19:33
kristate has joined #zig
19:37
m6w6 has quit [Ping timeout: 264 seconds]
19:37
m6w6 has joined #zig
19:38
kristate has quit [Ping timeout: 252 seconds]
19:48
wryun has quit [Quit: wryun]
19:53
<
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.
19:54
<
andrewrk >
and now I got my issue quota done for today so I'm going to work on windows stack traces
20:02
<
MajorLag >
oh boy, that'd be early christmas.
20:03
noonien has quit [Quit: Connection closed for inactivity]
20:36
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
20:37
mnoronha has joined #zig
20:49
kristate has joined #zig
21:01
adrusi has quit [Ping timeout: 252 seconds]
21:02
adrusi has joined #zig
21:08
kristate_ has joined #zig
21:11
kristate has quit [Ping timeout: 264 seconds]
21:18
kristate has joined #zig
21:20
kristate_ has quit [Ping timeout: 264 seconds]
21:26
davr0s has joined #zig
21:36
<
kristate >
andrewrk: hey, are you online?
21:37
<
andrewrk >
kristate, yep
21:38
<
kristate >
can we talk about #1403
21:38
<
kristate >
josh said he hasn't checked my code, yet it has been rejected
21:38
<
andrewrk >
yeah let's talk
21:39
<
kristate >
this has nothing to do with goto
21:41
<
andrewrk >
what do you think about josh's point at the end, with the code example?
21:41
<
kristate >
is there an example that is more fleshed out so that I can test it on the branch?
21:41
<
kristate >
I have no problems with writing code and talking about the points -- josh is bringing important points,
21:42
<
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
21:42
<
andrewrk >
there's no such thing as auto rejection - it's just me making a decision
21:42
<
andrewrk >
which becomes the new status quo
21:42
<
andrewrk >
and I respect you which is why I am willing to reconsider status quo
21:43
<
andrewrk >
but it puts the ball in your court
21:43
<
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
21:44
<
kristate >
I just want to write safe yet effective code, and your proposal makes lots of sense
21:45
<
kristate >
there was a case that josh brought, which I thought was valid and important
21:45
<
andrewrk >
before josh said anything, I was already uncomfortable with the if (!var->value->type) code
21:45
<
kristate >
but by informing the programmer that they are doing something that is not doable, then everything works out
21:46
<
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
21:46
<
andrewrk >
in the above example it would have hidden the root cause problem
21:46
<
kristate >
I agree with #1426
21:47
<
kristate >
and I was glad that to see the patch that followed.
21:48
<
andrewrk >
can you interact with josh on the issue? I'll re-open it
21:48
<
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
21:49
<
andrewrk >
and I really am sorry about rejecting your working code. it feels awful to do that
21:49
<
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"
21:50
<
kristate >
how do we write that up and test it so that I can run it on the branch>
21:50
<
andrewrk >
let me come up with some examples
21:54
<
kristate >
andrewrk: it's working?
21:54
<
kristate >
let me post what I have
22:01
<
andrewrk >
kristate, I'm waiting for my mac to install updates, it says 17 minutes left. sorry for the delay
22:07
<
kristate >
andrewrk: I think that josh is confused about the order in which the continue expression is executed
22:07
<
andrewrk >
I have some more examples I want to try
22:08
<
kristate >
the scope that we plug into the continue expr comes from the while body
22:08
<
kristate >
the decl of handle comes before the continue expr
22:09
<
kristate >
if handle is not available in all branches, then we return an error, which prompts the programmer to re-think their flow
22:10
<
kristate >
this is a
_good_ feature to have
22:10
<
andrewrk >
just a minute, working on a couple more examples
22:30
<
andrewrk >
kristate, updated
22:30
<
kristate >
let me check it out
22:32
<
andrewrk >
I used your branch for these examples
22:33
<
kristate >
the last one is causing an inf loop?
22:33
<
andrewrk >
yes - the continue jumps to the continue expression before x is declared and initialized
22:34
<
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
22:34
mnoronha has quit [Ping timeout: 252 seconds]
22:35
<
kristate >
andrewrk: but this is correct code, is it not?
22:35
<
andrewrk >
I don't understand the question
22:35
<
kristate >
was it supposed to not loop?
22:36
<
andrewrk >
do you understand that it is invoking undefined behavior?
22:37
<
kristate >
how is it undefined? the way that continue expr is implemented in the compiler, this is all fine
22:37
<
kristate >
in fact, it is doing the same thing, regardless of my code
22:37
<
andrewrk >
what value do you think x is the first time the expression i += x is evaluated?
22:37
<
kristate >
all my code does is give the return scope from the while body to the continue expression
22:39
<
andrewrk >
I feel like the fact that it is not clear to you what is happening is evidence that it is too complicated
22:39
<
kristate >
hmm, if we change var runtime_true = true; to const runtime_true = true;
22:39
<
kristate >
we get the reference
22:40
<
kristate >
cannot reference variable from unreachable code region
22:40
<
kristate >
andrewrk: I think there maybe something more sinister happening
22:41
<
kristate >
let me work on your test case -- it should be returning an error
22:41
<
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
22:42
<
kristate >
might be interesting to print out x
22:42
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
22:43
<
kristate >
andrewrk: yeah, just tried to print it out and its 0
22:43
<
andrewrk >
that's uninitialized memory
22:44
<
kristate >
yeah, but why isn't zig throwing an error?
22:44
<
andrewrk >
zig does catch that. if you run master branch zig on this example it's a compile error
22:44
<
kristate >
no no, that is only because of a scope difference
22:44
<
andrewrk >
scopes is how zig figures out if variables are declared or not
22:44
<
andrewrk >
each variable declaration starts a new scope
22:47
<
kristate >
hmm, let me play with it for 24 hours and if I can't do something about this, we can reject
22:47
<
andrewrk >
sounds good, let's revisit in 24 hours
22:47
<
kristate >
I am worried that down the line another problem may pop up
22:47
<
kristate >
I also want to understand scopes more
22:51
<
kristate >
okay, need to catch a bullet train to tokyo
22:56
kristate has quit [Ping timeout: 252 seconds]
22:56
fsateler has joined #zig
23:20
wink_ has quit [Remote host closed the connection]
23:31
hooo has quit [Ping timeout: 252 seconds]
23:43
return0e has quit [Read error: Connection reset by peer]
23:43
return0e has joined #zig
23:56
darithorn has joined #zig