ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
isd has joined #zig
jfo has quit [Ping timeout: 256 seconds]
ltr_ has joined #zig
<ltr_>
hello
Ichorio has quit [Ping timeout: 256 seconds]
<MajorLag>
Hi
<GitHub23>
[zig] AndreaOrru pushed 2 new commits to master: https://git.io/vAjbO
<GitHub23>
zig/master d062139 Andrea Orru: zen-specific: main -> _start
<MajorLag>
Even after updating to an artifact after the comptime patch, it still manages to screw up looping.
steveno_ has quit [Quit: Leaving]
wishstudio has quit [Remote host closed the connection]
wishstudio has joined #zig
noonien has quit [Quit: Connection closed for inactivity]
isd has quit [Quit: Leaving.]
davr0s has joined #zig
_whitelogger has joined #zig
<andrewrk>
MajorLag: I just pushed a bug fix related to improperly caching comptime. Are you running latest master?
<andrewrk>
Sorry just saw your message
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<andrewrk>
Apologies for the bug. I'm very interested in a test case
<MajorLag>
Yeah, I still haven't nailed it down. I thought the patch fixed it because it fixed my original test case, but it was a no go.
<MajorLag>
ok... this is weird. I've uncommented the code to work on it again and it is working now... only it shouldn't be, because I have a compileLog statement in the middle of a loop it has to go through.
<MajorLag>
oh, nevermind. I forgot to disable some code that skips all the work if the source and destination encoding match.
<MajorLag>
ok... it looks like it might have to do with taking a slice of a comptime slice. In which cast it is incendental that it happens inside of a loop.
cenomla has quit [Quit: cenomla]
<MajorLag>
Ok, I think it's actually pretty simple. Taking a slice of a comptime var turns it into a const slice.
<MajorLag>
...no there's more to it than that...
<MajorLag>
andrerk: #826. At comptime, a slice of a slice of an array is considered const. One fewer slice and it works fine.
<MajorLag>
...and after hacking around that it looks like there's something else causing comptime to fail at this. Something to deal with in the morning I guess.
<andrewrk>
MajorLag: I really appreciate the test case. I know that was a pain to produce
<andrewrk>
At least whenever I fix one of these, I add a test case. So these bugs are getting squashed permanently
jfo has joined #zig
jfo has quit [Ping timeout: 240 seconds]
jfo has joined #zig
jfo has quit [Ping timeout: 264 seconds]
return0e has quit [Ping timeout: 268 seconds]
return0e has joined #zig
zigzag has joined #zig
davr0s has joined #zig
tiehuis has quit [Quit: WeeChat 2.0.1]
jfo has joined #zig
jfo has quit [Ping timeout: 264 seconds]
zigzag has quit [Ping timeout: 260 seconds]
jfo has joined #zig
jfo has quit [Ping timeout: 252 seconds]
jfo has joined #zig
jfo has quit [Ping timeout: 256 seconds]
Ichorio has joined #zig
jfo has joined #zig
jfo has quit [Ping timeout: 255 seconds]
jfo has joined #zig
jfo has quit [Ping timeout: 248 seconds]
jfo has joined #zig
jfo has quit [Ping timeout: 260 seconds]
jfo has joined #zig
jfo has quit [Ping timeout: 252 seconds]
jfo has joined #zig
jfo has quit [Ping timeout: 276 seconds]
return0e has quit [Ping timeout: 260 seconds]
return0e has joined #zig
Hejsil has joined #zig
davr0s has quit [Ping timeout: 245 seconds]
<MajorLag>
Happy to help, if I can. I should get around to getting interfaced with the debug SDK so we can do something about that COFF trace support. All my tedious work with the win32 api before should help, it seemed to include a lot of
<MajorLag>
COM stuff.
<MajorLag>
I just wanted to finish this first, a more complete unicode library. It supports UTF-32/16/8 with or without BOM in BE or LE. Comptime conversion is currently the only thing missing I think.
<MajorLag>
well, that and some little things, cleanups, and WTF-8 support which would apparently be useful for interacting with certain systems.
jfo has joined #zig
Tobba has joined #zig
<MajorLag>
andrewrk: the latest comptime issue seems to be that it is memorizing the result of an iterator's next() function from the end of the previous invokation of the comptime function. I have some stuff to do for a few hours but I'll try to put together a test case later.
jfo has quit [Ping timeout: 256 seconds]
davr0s has joined #zig
jfo has joined #zig
return0e has quit [Ping timeout: 240 seconds]
return0e has joined #zig
jfo has quit [Ping timeout: 260 seconds]
jfo has joined #zig
jfo has quit [Ping timeout: 240 seconds]
jfo has joined #zig
jfo has quit [Ping timeout: 240 seconds]
<ltr_>
the tetris code has a problem , i dont know if it is cos im compiling it with the master version
<ltr_>
z/tetris/src/static_geometry.zig:64:67: error: cast discards const qualifier, i was able to compile and run it changing the constants to variables
jfo has joined #zig
jfo has quit [Ping timeout: 240 seconds]
jfo has joined #zig
jfo has quit [Quit: WeeChat 1.9.1]
<ltr_>
how can i add static libraries to an executable in the build.zig file?
<andrewrk>
MajorLag, ok thanks, I'll look at your other issue now
<andrewrk>
ltr_, fixed tetris
<ltr_>
just comiled it using the docker image, and it works fine
<ltr_>
the resulting docker image lacks gcc-6 libs
<ltr_>
for crtbegin/end
<andrewrk>
ltr_, for static libs, try addObjectFile
<ltr_>
to the executable?
<andrewrk>
that should maybe be renamed addObjectOrStaticLib
<ltr_>
so instead of exe.linkSystemLibrary("png");
<ltr_>
it should be exe.addObjectFile
<ltr_>
or something like that
<andrewrk>
exe.addObjectFile("libpng.a")
<andrewrk>
yeah
<ltr_>
tetris runs perfect
<ltr_>
andrewrk: should i be able to use libuv now?
<andrewrk>
you can add --verbose-link to `zig build` to make sure it links correctly
<MajorLag>
andrewrk: the conditions for this case are not obvious. Could be a while before I have a test case. Something is really weird about it, the compileLog statements are not being output in the order I would expect.
<andrewrk>
even if you have a large test case with multiple files, maybe you can push to a branch and tell me to check it out
<MajorLag>
Might come to that. It's only two files, the unicode implementation and the tests.
<MajorLag>
....and the relvent tests could be easily included in the main file I suppose.
<ltr_>
?.c:1:1: note: 'uv_close_cb' depends on itself
<ltr_>
I'm getting a lot of redefinition/invalid zig code generated/depends on it self errors using libuv, i suppose complex c unions and structs still have some problems
<andrewrk>
ltr_, I'm working on a zig-native standard library event framework using async/await
<MajorLag>
There's a known issue with "depends on itself" false positives.
<andrewrk>
did you know we have async/await now?
<ltr_>
yes, ill check it out, may be i can make the async part by my self not reliying on libuv
<andrewrk>
to be useful you'll still need a userland event loop of some kind
Tobba has quit [Remote host closed the connection]
<MajorLag>
andrewrk, what precisely does it mean when @compileLog outputs "(runtime value)"? I have been assuming it means that @compileLog was enountered while compiling code for runtime instead of being run during comtime, is that correct?
<andrewrk>
MajorLag, it means that you passed a value to @compileLog that was not known at compile time
<andrewrk>
I think that's the same thing as what you said
<MajorLag>
I don't know, my interpretation of what you said would mean that it shouldn't be logging "(runtime value)" unless I call something with @compileLog in it at run time. In my tests, it seems to always be the last value returned from a comptime var.
Hejsil has quit [Quit: Leaving]
<MajorLag>
Hmm... looks like comptime does weird things with error unions. Might be related. For instance, it can catch an error but it doesn't appear to execute the catch statement.
<MajorLag>
Is it possible that the compiler could optimize out a @compileLog statement?
<MajorLag>
`var x = func(); @compileLog(x); return x;` seems to ignore the log.
<MajorLag>
....except only in some cirucmstances... This is weird.
<MajorLag>
I think I'm dealing with @compileLog bugs making it hard to work out the conditions for the comptime bug.