ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
MajorLag has joined #zig
<presiden> ah, solved
<andrewrk> presiden, did the above code work?
<diltsman> andrewrk, I added the export to the variable holding the vector table. That did require the type of the vector table to conform to the C ABI.
<andrewrk> presiden, ah I see the problem. I'm going to push a commit that makes your code work verbatim.
<andrewrk> diltsman, here's the code I tried: https://clbin.com/YL1DH
<diltsman> andrewrk, that is working now. Not certain what I was doing differently before that the u32 didn't work there.
<presiden> andrewrk: I'm doing something along: comptime var n = 0; comptime { n = foo(10) }; var arr: [n]bool = undefined;
jjido has joined #zig
<andrewrk> look at the new test case at the bottom
<presiden> andrewrk: nice :)
<diltsman> Looks like the last unexpected thing is that while(true){} generates a pair of consecutive unconditional branches that both branch to the second branch instruction.
<jjido> Is it worth optimising empty brackets ?
<andrewrk> diltsman, are you referring to debug mode assembly?
<diltsman> Whatever the default output is when mode = b.standardReleaseOptions()
<andrewrk> diltsman, I would make a case that the unnecessary branch instruction is harmless - debug mode favors fast compilation, not optimal machine code
<andrewrk> the default mode is debug
<andrewrk> does the unnecessary branch go away with -Drelease-fast ?
<andrewrk> that said, at some point I will take a look and see if there's some simple fix to emit better debug mode code. I'm doing quite a bit of that in the copy-elision-2 branch
<diltsman> andrewrk, I didn't realize that it was debug mode. Given what I understand about how loops tend to be transformed (naively) to assembly, the double branch wasn't too much of a surprise. However, I expected a few other inefficienies in debug mode, that is what threw me off.
<diltsman> -Drelease-fast eliminates the double branch.
<andrewrk> diltsman, I suspect you may be interested in the work I've been doing in the copy-elision-2 branch. Here's an example: https://i.imgur.com/keMRJ3r.png
<andrewrk> it's showing the LLVM IR, not assembly, but you can see on the right there are fewer alloca and memcpy instructions
<andrewrk> I'm hoping to get this merged within the next couple weeks
<andrewrk> this will significantly improve debug builds
jjido has quit [Remote host closed the connection]
wink_ has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
wink_ has joined #zig
<diltsman> andrewrk, I saw that (maybe a different image) on Twitter. Definitely has promise. Copy elision was a major improvement for C++11.
steveno has quit [Remote host closed the connection]
<presiden> andrewrk: related to previous discussion. should something along this be allowed too: var arr = []bool{false} ** foo(10);
<andrewrk> ah, presiden, I just opened an issue for that. It should be easy to solve: https://github.com/ziglang/zig/issues/1707
<diltsman> Took some stupid manipulation of file locations, but I finally got the Zig program on the Arduino Due and paused the debugger. Appears that the debug locations line up as expected.
_whitelogger has joined #zig
<hryx> Can the weekly Twitch stream be advertised on ziglang.org and the GitHub wiki?
<hryx> I'm surprised I only found out about it yesterday while reviewing some chat logs
jjido has joined #zig
wilsonk has quit [Read error: No route to host]
wilsonk has joined #zig
jjido has quit [Read error: Connection reset by peer]
dec05eba_ has joined #zig
<dec05eba_> I noticed that if you have a public struct in a file and then a non-public function in the struct scope you can call the non-public function from another file that uses @import. Is this expected behavior?
jjido has joined #zig
davr0s has joined #zig
_whitelogger has joined #zig
dec05eba_ has quit [Remote host closed the connection]
jjido has quit [Read error: No route to host]
porky11 has joined #zig
m4ge123 has quit [Read error: Connection reset by peer]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
m4ge123 has joined #zig
porky11 has quit [Remote host closed the connection]
porky11 has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
nore has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
return0e has quit [Remote host closed the connection]
davr0s has joined #zig
return0e has joined #zig
merry has joined #zig
profan has joined #zig
shachaf has joined #zig
wootehfoot has joined #zig
m4ge123 has quit [Read error: Connection reset by peer]
m4ge123 has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]