ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
atk has quit [Quit: Well this is unexpected.]
<scientes> how do i build the testcase so i can use gdb on it?
atk has joined #zig
<kristate> last test case is compiled to ./zig-cache/test so you can use lldb ./zig-cache/test
<scientes> ok there is a basic test
<scientes> hmm I think there is something wrong
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<scientes> whever i program it up i get something wrong :(
kristate has quit [Remote host closed the connection]
kristate has joined #zig
<scientes> k got it fixed
<kristate> scientes: cool
<andrewrk> unique_id, slicing asserts that start < len and end <= len
<andrewrk> if you want just the pointer of a slice you can access it with the ptr field - and if you slice that pointer there is no safety
<andrewrk> btw unique_id I'm trying to run a hello world vulkan example and it's segfaulting in libc, do you know anything about this?
<andrewrk> https://clbin.com/4VWFi - building with clang++ -std=c++11 -o hello hello.cpp -lvulkan -lglfw
<andrewrk> the segfault is in ____longjmp_chk () in libc.so, with no stack trace above that
<andrewrk> Dirkson, coroutines can be concurrent if you use std.event.Loop.initMultithreaded
<andrewrk> you can see some std lib tests for example and the self hosted compiler
kristate has quit [Remote host closed the connection]
zolk3ri has quit [Quit: leaving]
kristate has joined #zig
<kristate> back
<kristate> andrewrk: online? :)
<andrewrk> hi kristate
<kristate> yay
<andrewrk> nice work
<kristate> let me push what I have
<kristate> andrewrk: pushed
<kristate> debating on what to use on macos for futexes -- lots of implementations use pthread API
kristate has quit [Remote host closed the connection]
kristate has joined #zig
<kristate> hmm got disconnected for a bit
<andrewrk> kristate, probably kqueue
<kristate> andrewrk: we are using kqueue for event notification in place of epoll on linux, but how should we sync threads
<kristate> you are using futex on linux
<kristate> but the equivalent doesn't exist on osx -- lots of people are rolling their own
<kristate> we could use a named pipe and send a single character to it
<kristate> and use kqueue to poll on it
<andrewrk> kristate, when you say how to sync threads, what do you mean?
<andrewrk> I already implemented a solution to sync threads using kqueue for M:N threading in std.event.Loop
<andrewrk> are you referring to how to implement std.Mutex?
<andrewrk> (which is right now a spinlock with a TODO comment)
<kristate> for the FS thread
<andrewrk> does darwin need an FS thread?
<kristate> yes, same as linux -- libuv and other bittorrent libraries are all creating threads
<kristate> we can use kqueue for file watching and directory watching will require another thread
<kristate> dir watching will use the FSEvents API
<andrewrk> really? another thread for dir watching?
<andrewrk> ahh
<kristate> FSEvents uses Apple's CFLoop API for event handling
<kristate> I wonder if we can back the FS thread of CFLoop on mac
<kristate> and then just use CFLoop primitives to signal the thread....
<kristate> that is, replace the futex with CFRunLoopRun
<kristate> it looks like we can wake-up the loop with pCFRunLoopWakeUp
SimonNa has quit [Quit: Leaving]
kristate has quit [Remote host closed the connection]
tiehuis has joined #zig
<tiehuis> Dirkson: updated the zig benchmarks game repo
<Dirkson> tiehuis: Neat! I'll see if I can't look into that soon.
<tiehuis> All the examples now work and are accurate and ive added a test script to compare all against each other
<tiehuis> There are 3 programs left to implement
kristate has joined #zig
<Dirkson> Neat!
<Dirkson> tiehuis: So far, so good. Running it on the laptop since I'm in bed already.
<Dirkson> The zig version of fasta is actually faster than C on my machine, by like 25%
<tiehuis> I havent rally looked in depth at optimizing anywhere yet so most are just a rough translation
v1zix has joined #zig
<Dirkson> The C should be pre-optimized, no?
<Dirkson> tiehuis: You've got two sets of identical "Fasta" tests in the run file
<Dirkson> And on my computer, both the C and Zig version of Reverse Compliment returned "command terminated by signal 11". Not sure if that's worth chasing
<Dirkson> tiehuis: "libgomp" appears to be a dependency of the C portion of this stuff as well, but isn't mentioned in the readme
<tiehuis> Ah yes will add that to readme pcre too
<Dirkson> Hey, what units is "maxresident" in? Because zig appears to be *handily* beating C by a factor of around 5 on most of my tests
<Dirkson> Well, at least 5
<tiehuis> Zig startup code is proabably lighter than c for the examples that dont allocate much
<tiehuis> Might be that would need to check
v1zix has quit [Quit: Page closed]
davr0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
zolk3ri has joined #zig
tiehuis has quit [Quit: Bye]
davr0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<unique_id> andrewrk: I've got no clue. I ran your example with 09_shader_base.vert/.frag and it ran for me. The only time I've had issues running code that should work is when I've accidentally had the nouveau drivers running instead of the nvidia one.
<unique_id> to understand how glsl is changed for vulkan, read GL_KHR_vulkan_glsl.txt
davr0s has joined #zig
<unique_id> maybe ask on ##vulkan
bheads has joined #zig
<unique_id> It turns out that vulkan uses stdcc on windows. We have stdcallcc but is there any way to do this conditionally? I had the idea of conditionally importing a different file for windows (as preferrably a temporary solution) but I'm getting syntax errors. This is for my vk.xml conversion projection, there's no rush.
<unique_id> project*
<unique_id> Ehem, stdcall not stdcc
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chandlore_ has quit [Ping timeout: 240 seconds]
DuClare has quit [Ping timeout: 240 seconds]
Triplefox[m] has quit [Ping timeout: 240 seconds]
pqflx3[m] has quit [Ping timeout: 240 seconds]
LordeKumamon[m] has quit [Ping timeout: 240 seconds]
vec__ has quit [Ping timeout: 240 seconds]
jab has quit [Ping timeout: 240 seconds]
davr0s has joined #zig
kristate has quit [Remote host closed the connection]
edr has left #zig ["Leaving"]
edr has joined #zig
<MajorLag> andrewrk, compiler still doesn't do any caching between builds right?
<MajorLag> as of 0.2.0+1f4c7d5e?
very-mediocre has joined #zig
<unique_id> Is there no way to @import() from the root of the project so paths do not look like this: "../../foo.zig"?
<bheads> does --isystem work for zig files ir just .h files?
bheads has quit [Ping timeout: 240 seconds]
<MajorLag> I think I've discovered a new defer bug. Could be my fault and I don't see how yet. Looking in to it.
bheads has joined #zig
<MajorLag> Nevermind, this one's on me.
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<andrewrk> MajorLag, correct - stage1 does no caching
atk has quit [Ping timeout: 265 seconds]
<andrewrk> unique_id, it used to work that way, but I changed it to be relative to the current path
atk has joined #zig
<unique_id> Alright. Both have their benefits and downsides
ofelas has quit [Quit: shutdown -h now]
ofelas has joined #zig
<unique_id> andrewrk, did you see my issue with vulkan's usage of stdcall on windows? What on earth could solve this issue?
kristate has joined #zig
very-mediocre has quit [Ping timeout: 252 seconds]
<andrewrk> unique_id, I think that I was trying to send shader source to the driver rather than SPIR-V, but for some reason the validation layer wasn't catching it, and it was crashing instead of giving an error message
<andrewrk> unique_id, sorry I meant to add a tidbit to the last message - one strategy you can do is to have a file that references everything else in your library. for example std does this - std/index.zig references everything else and all the files in std do const std = @import("../../index.zig");
<andrewrk> so then it's only 1 weird path and everything else is referenced through the std variable
<andrewrk> another option is to map packages into your package namespace so that @import("foo") references whatever file you want
<andrewrk> alright I need to get through these pull requests
<unique_id> andrewrk: Oh okay. Btw glslc is the glsl to spirv compiler I use. It's intuitive and great. It comes with the vulkan sdk.
<andrewrk> thanks! I was trying to find something to do that
<andrewrk> unique_id, https://i.imgur.com/RpUy0Qu.png
<unique_id> There it is :)
davr0s has joined #zig
<andrewrk> if I'm going to do any real work I'll need to make sure this validation layer thing is working
<unique_id> andrewrk: Change VkInstanceCreateInfo's sType to something else. VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
<andrewrk> unique_id, I get a shaded triangle same as before
<unique_id> no message in the terminal?
<andrewrk> correct
<unique_id> that's odd. I get an error
<unique_id> using your demo
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<andrewrk> (+ your change)
<andrewrk> I'm guessing that the validation layers aren't working for me
<andrewrk> which is why I was getting a segfault instead of an error message for sending source instead of SPIR-V
<unique_id> andrewrk, did you see my issue with vulkan using the stdcall calling convention only on windows? I don't know of a way to represent that in Zig.
<andrewrk> unique_id, oh I'm sorry, you mentioned this earlier and I didn't understand
<andrewrk> looking now
<andrewrk> ah
<andrewrk> we can talk about a way to improve this, but here's how to do it right now
<andrewrk> vulkan/windows.zig: put all the extern definitions there that have stdcallcc
<andrewrk> vulkan/other.zig: put all the extern definitions there without stdcallcc
<andrewrk> (sorry I mean fn prototypes not definitions)
davr0s has joined #zig
<andrewrk> vulkan.zig: pub use switch(builtin.os) {builtin.os.windows => @import("vulkan/windows.zig"), else => @import("vulkan/other.zig"), };
<unique_id> ok I'll try that again, for some reason I was getting syntax errors
<unique_id> I couldn't figure it out
<andrewrk> oh, here's the issue that will make this way way simpler: https://github.com/ziglang/zig/issues/661
<andrewrk> I can prioritize this if it would unblock you
<unique_id> no the use switch will work fine
<unique_id> doh. The syntax error I was getting was in a different file, the one I was importing.
<andrewrk> #661 is definitely a nicer way to solve this
<unique_id> and the line number was the same line number that I was editing
<andrewrk> ha wow
ofelas has quit [Quit: shutdown -h now]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
davr0s has quit [Client Quit]
davr0s has joined #zig
davr0s has quit [Client Quit]
zolk3ri has quit [Quit: leaving]
kristate has quit [Remote host closed the connection]
kristate has joined #zig
kristate has quit [Remote host closed the connection]
<scientes> why can't i "comptime if ()" ?