ChanServ changed the topic of #zig to: zig programming language | https://ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
_whitelogger has joined #zig
laaron has quit [Remote host closed the connection]
laaron has joined #zig
<scientes> structs are allowed to contain a mix of comptime and runtime values.
<scientes> yeah that makes sense
<scientes> yeah that is cool
<scientes> but what about calling C variadic functions?
<scientes> I guess we could make those also called by using these anonymous structs
avoidr has quit [Quit: leaving]
<scientes> both of the translate-cs crash for me
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #zig
dimenus has quit [Ping timeout: 272 seconds]
ntgg has joined #zig
ntgg has quit [Ping timeout: 245 seconds]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #zig
laaron has quit [Remote host closed the connection]
laaron has joined #zig
_whitelogger has joined #zig
laaron has quit [Remote host closed the connection]
laaron has joined #zig
darithorn has quit [Quit: Leaving]
_whitelogger has joined #zig
ltriant has quit [Quit: leaving]
bgiannan has left #zig ["WeeChat 2.5"]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #zig
laaron has quit [Remote host closed the connection]
laaron has joined #zig
eagle2com has joined #zig
laaron has quit [Remote host closed the connection]
laaron has joined #zig
eagle2com has quit [Ping timeout: 246 seconds]
samtebbs has quit [Ping timeout: 246 seconds]
ntgg has joined #zig
ntgg has quit [Ping timeout: 258 seconds]
laaron has quit [Remote host closed the connection]
laaron has joined #zig
hio has joined #zig
kristoff_it has joined #zig
eagle2com has joined #zig
<hryx> There seems to be weird activity on the Community wiki page - two users fighting over which unofficial Discord community should be listed? https://github.com/ziglang/zig/wiki/Community/_history
<hryx> is there a way to be notified of changes to the GitHub wiki?
noonien has joined #zig
kristoff_it has quit [Remote host closed the connection]
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 245 seconds]
kristoff_it has joined #zig
kristoff_it has quit [Remote host closed the connection]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #zig
Tetralux_ has joined #zig
kristoff_it has joined #zig
Tetralux has quit [Ping timeout: 244 seconds]
_whitelogger has joined #zig
dimenus has joined #zig
dimenus has quit [Remote host closed the connection]
eagle2com has quit [Ping timeout: 258 seconds]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #zig
<scientes> lawl
<scientes> they should just join the IRC channel :)
<Tetralux_> daurnimator: I'm curious about the usage of https://github.com/ziglang/zig/issues/2940.
<Tetralux_> Are we talking about being able to do `show(usize)`?
<lunamn> iirc the whole discord thing was "solved" as the two owners reached an "agreement"
Tetralux_ is now known as Tetralux
<nrdmn> huh, struct attributes can have default values?
dimenus has joined #zig
dimenus has quit [Client Quit]
<nrdmn> thanks mikdusan. I thought I remembered a discussion recently concluding that we don't want default values
<scientes> so translate-c (both version) just crash for me
<scientes> it also errors when <math.h> is included
<scientes> and yes i did do ninja installl
<mikdusan> scientes: branch? pr?
<scientes> master
return0e has quit [Ping timeout: 246 seconds]
<scientes> why do i have to list the type twice
<scientes> exp2_poly: [5]f64 = [_]f64{
<scientes> oh i don't
<fengb> I have a proposal to infer the type declaration for struct fields
<scientes> it seems to work like this
<scientes> tab = [256]u64{
<Tetralux> fengb: Yeah, I'd be for that too.
<Tetralux> Esp for things like `n = false`
eagle2com has joined #zig
marijnfs has joined #zig
eagle2com has quit [Ping timeout: 246 seconds]
Tetralux_ has joined #zig
return0e has joined #zig
Tetralux has quit [Ping timeout: 245 seconds]
halosghost has joined #zig
darithorn has joined #zig
companion_cube has joined #zig
SyrupThinker has quit [Quit: WeeChat 2.4]
Tetralux_ is now known as Tetralux
eagle2com has joined #zig
eagle2com has quit [Read error: Connection reset by peer]
laaron has quit [Remote host closed the connection]
laaron has joined #zig
<Tetralux> What syntax should you use to return a pointer to a struct from an stdcallcc fn?
<Tetralux> .. that's external.
<Tetralux> Tried [*c]T, [*]T, ?[*]T, ?*.
<Tetralux> All say: error: return type '?*sockets_windows.NativeSocket' not allowed in function with calling convention 'stdcallcc'
<Tetralux> It only says that if the type is extern struct though.
<Tetralux> T is @OpaqueType(), then Zig crashes for some reason.
<Tetralux> Trying to narrow it down.
<Tetralux> Trying to narrow it down.
<mikdusan> what does sockets_windows.NativeSocket look like?
marijnfs has quit [Ping timeout: 244 seconds]
<nrdmn> how can I cast 0 to a *c_void?
laaron has quit [Remote host closed the connection]
<mq32> isn't that a `?*c_void`?
laaron has joined #zig
<nrdmn> donpdonp: @intToPtr(*allowzero c_void, 0) gives "error: null pointer casted to type '*c_void'"
<donpdonp> nrdmn: hmm. havnt run into that. whats the signature of the function you're trying ot call
<nrdmn> donpdonp: extern fn (MyStruct, usize, usize, *c_void) void
<nrdmn> s/MyStruct/MyEnum/
<presiden> isn't null pointer not guaranteed to be always zero
<halosghost> in C?
<donpdonp> nrdmn:i think you can simply say ...usize, null);
<nrdmn> presiden: on my platform it is always guaranteed to be zero
<nrdmn> donpdonp: error: expected type '*c_void', found '(null)'
<mq32> nrdmn, donpdonp: https://godbolt.org/z/wQQjVr
<nrdmn> mq32: is ?*c_void always the same as *allowzero c_void?
<mq32> afaik optional pointers are stored via a NULL value
<nrdmn> oh right, the documentation says "If you want to represent null pointers, use Optional Pointers instead."
<nrdmn> oh, hmm. I misread that.
<donpdonp> nrdmn: your original try works for me https://godbolt.org/z/_bZK6K
<donpdonp> i havent even heard of allowzero until today
<mq32> allowzero is relevant only for cases where (void*)0 is actually a valid address (like on embedded platforms)
<halosghost> which is a cool feature
<mq32> sure thing!"
<mq32> but "optional allowzero pointer" will not have pointer width
<nrdmn> sorry, compiled with this: https://github.com/nrdmn/zig/tree/uefi
kristoff_it has quit [Ping timeout: 248 seconds]
lunamn has quit [Ping timeout: 244 seconds]
lunamn has joined #zig
Tetralux has quit [Ping timeout: 246 seconds]
Tetralux has joined #zig
<Tetralux> mikdusan: It was an @OpaqueType(). I worked around it now, but I had an OS type (OST) which I described as @OpaqueType(), and was storing it in a struct as ?*OST.
<Tetralux> Describing `const OST = *@OpaqueType()` (note the *), worked around the assert failure in zig.exe
Akuli has joined #zig
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #zig
lunamn has quit [Ping timeout: 248 seconds]
lunamn has joined #zig
kristoff_it has joined #zig
kristoff_it has quit [Remote host closed the connection]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron- has joined #zig
kristoff_it has joined #zig
Sobeston has joined #zig
Sobeston has left #zig [#zig]
kristoff_it has quit [Ping timeout: 246 seconds]
Sobeston has joined #zig
<Sobeston> Any good way to find what's crashing the compiler? I've been running zig build-exe and an exe is outputted, but it does literally nothing. I have a std.debug.warn() on the very first line of main, but it doesn't work
<Sobeston> I'm sure something else in the source is messing the compilation up, but I can't find it
<emekankurumeh[m]> can you paste the source?
<Sobeston> I can't, unfortunately - doing a rewrite of closed source code I don't own. Is there any general advice for this sort of thing?
<emekankurumeh[m]> hmm, are you on windows?
<Sobeston> yes, and I am calling kernel32 + user32 functions. On 0.4.0
<emekankurumeh[m]> do you just have a `pub main` in your source file?
<emekankurumeh[m]> *root file
<Sobeston> yes. The printing was working earlier, but through the addition of some functions (which I call after the print) it has since stopped
<emekankurumeh[m]> one possibility is that warn is failing silently and returning: https://github.com/ziglang/zig/blob/0.4.0/std/debug.zig#L45
<emekankurumeh[m]> does it still with those other calls removed?
<Sobeston> if I remove the calls to those functions, the code still does nothing. But if I comment all the functions out as well as the calls, it works
<emekankurumeh[m]> can you say what functions you are calling?
<Sobeston> unfortunately no
<emekankurumeh[m]> instead of calling std.debug.warn can you try printing to stderr manually without the catch return?
<Sobeston> same problem as with the warn. I think it's to do with weird pointer casts in the functions - I'll try and find what the problem is and maybe file an issue
<emekankurumeh[m]> does it occur with any of the functions or is it a specific one?
Tetralux has quit [Ping timeout: 245 seconds]
<Sobeston> one that calls another
<Sobeston> I think it might be due to the compiler accidentally accessing the [0] index of an undefined array
<emekankurumeh[m]> ia the return code non-zero?
<Sobeston> the compile returns 0, but the executable exits with -1073741511
<Sobeston> aha if I strip off half (the first 4 bytes) of -1073741511's binary which are all 1, I am left with C0000139. Google seems to suggest that this is entry point not found
Ichorio has joined #zig
ntgg has joined #zig
Tetralux has joined #zig
dimenus has joined #zig
ky0ko has quit [Remote host closed the connection]
ntgg has quit [Ping timeout: 268 seconds]
Sobeston has quit [Ping timeout: 260 seconds]
<dimenus> how do you utilize an llvm intrinsic?
<dimenus> via the api?
<emekankurumeh[m]> adding an builtin to zig?
<dimenus> not sure what the front end api will look like for this
<emekankurumeh[m]> the best resource on doing that would probably be https://github.com/ziglang/zig/pull/2709
<dimenus> thanks
<dimenus> that's the perfect PR to link to
<emekankurumeh[m]> are we allowed to post links to executables/binaries here?
Akuli has quit [Remote host closed the connection]
<dimenus> not sure
halosghost has quit [Quit: WeeChat 2.5]
fubd has joined #zig
dimenus has quit [Ping timeout: 268 seconds]
fubd has quit [Remote host closed the connection]
<scientes> oh hes gone....
dimenus has joined #zig
marijnfs has joined #zig
<marijnfs> was there no status update?
<scientes> dimenus, awesome to see someone using my work!
<scientes> dimenus, just saw this https://pastebin.com/BvYFW9Ni
dimenus has quit [Ping timeout: 245 seconds]
<emekankurumeh[m]> Sahnvour, rust has several coff/pe parsing libraries that might be of use
<scientes> I think that is pretty readable
<scientes> wait, ** could be implemented at runtime with @shuffle
<scientes> on vectors or arrays
ntgg has joined #zig
marijnfs has quit [Quit: WeeChat 2.4]
<Sahnvour> emekankurumeh[m]: my problem is about the PDB format
<Sahnvour> or rather, MSF file format ... but in any case we have llvm's doc and code, and microsoft's code, just need to figure out where the error lies
ntgg has quit [Ping timeout: 245 seconds]