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/
leeward has quit [Remote host closed the connection]
nullheroes has quit [Quit: WeeChat 2.9]
klltkr has quit [Ping timeout: 246 seconds]
zippoh has quit [Ping timeout: 240 seconds]
ronsor has joined #zig
ky0ko_ has joined #zig
<ky0ko_> so, I have a piece of code that i've whittled down to a much smaller test case, i'm trying to figure out if i'm doing something wrong or if it can be considered a bug
<ky0ko_> basically, i have a typedef in some C code i am importing, a variable of that type, and a function that accepts a variable of that type. i am trying, in zig code, to pass that variable to that function. it does not compile.
<ky0ko_> hm. actually you know what that's not a good representation of the original code, since it can be fixed with an & and the original can't
ur5us has joined #zig
klltkr has joined #zig
ur5us has quit [Ping timeout: 244 seconds]
waleee-cl has quit [Quit: Connection closed for inactivity]
<daurnimator> andrewrk: re: frank's PR: what do you think about the `inline` on the functions?
_whitelogger has joined #zig
stripedpajamas has joined #zig
knebulae has joined #zig
stripedpajamas has quit [Quit: sleeping...]
_whitelogger has joined #zig
stripedpajamas has joined #zig
cole-h has joined #zig
_whitelogger has joined #zig
ur5us has joined #zig
knebulae has quit [Read error: Connection reset by peer]
klltkr has quit [Ping timeout: 240 seconds]
ur5us has quit [Ping timeout: 260 seconds]
stripedpajamas has quit [Quit: sleeping...]
marnix has joined #zig
stripedpajamas has joined #zig
cole-h has quit [Quit: Goodbye]
stripedpajamas has quit [Ping timeout: 256 seconds]
ur5us has joined #zig
bgiannan has joined #zig
decentpenguin has quit [Quit: ZNC crashed or something]
decentpenguin has joined #zig
ur5us has quit [Ping timeout: 260 seconds]
ur5us has joined #zig
Biolunar has quit [Ping timeout: 260 seconds]
_whitelogger has joined #zig
wootehfoot has joined #zig
st4ll1 has quit [Ping timeout: 265 seconds]
st4ll1 has joined #zig
<danyspin97> do Windows and Unix have the same strerror messages?
<daurnimator> no]
<daurnimator> they aren't even consistent between unices, libcs, releases of libcs, or language settings
<danyspin97> Ah, I see :/
<danyspin97> so zig strerror function should call system strerror
<daurnimator> or make up its own
<danyspin97> I thought about a simple `return switch (errno) { ERRCODE => "message", };`
craigo has joined #zig
drewr has quit [Ping timeout: 260 seconds]
<daurnimator> danyspin97: usually the (english version of the) error code is the most useful thing..
<daurnimator> its the thing to google; or to find in docs
<daurnimator> often the string are localized... but don't provide enough information
<danyspin97> However, an application should show the error message instead of a code (imho)
<pixelherodev> Error message doesn't provide much useful info either
<pixelherodev> Code is at least Duckable
drewr has joined #zig
<danyspin97> "unable to do X: 22" it's unfriendly
<danyspin97> they gives you an idea, like "no more memory", "system is fucked up" or just "no permission"
<pixelherodev> I'd think e.g. ENOENT is more useful than the number
<pixelherodev> But codes don't really map to messages
<pixelherodev> There's too much context for that
<gonz_> Error codes/values are for the application to decide what to show, though. Generic "You know what you're doing strings" are useless both to end users and the application logic.
<gonz_> Any app using networking that decides to punt error strings forward to the user comes to mind. "Broken pipe"; useful.
<gonz_> "Connection reset by peer", I'm sure that means something to Joe Average
<gonz_> "But at least we showed a string"... You may as well have shown a code at that point, but better yet you could've just handled codes and dispatched proper messages based on them.
<danyspin97> I think strerror messages are the best tradeoff
<daurnimator> gonz_: is "Connection reset by peer" really that much more useful than ECONNRESET ?
<gonz_> daurnimator: That's my point. It's not useful and it's not something that should end up in end-users' information flow.
<daurnimator> IMO it should end up the error message, so that the user can google it and try to diagnose; or alternatively copy/paste into a support request
<gonz_> Clearly values should've been dispatched on at some point and a useful error message should've been shown instead.
<daurnimator> the support agent having the french translation of "Connection reset by peer" isn't super helpful
<daurnimator> also often errors like that have common solutions
<daurnimator> e.g. "Connection reset by peer" might be caused by a misconfigured firewall
<gonz_> I think if the person who's expected to end up with the information is technically inclined and wants to have a clear picture of the situation, error codes are more concise and about as useful to the end-user.
<gonz_> If all they're going to do is forward the information to support, you may as well just have magic codes and be done with it.
<gonz_> If you're actually trying to help the end-user, bite the bullet and write real, informative error messages based on the error codes.
<gonz_> This garbage people do in the middle of the spectrum where they use generic strings that mean next too nothing to normal people is just the worst of two worlds.
radgeRayden has joined #zig
m6w6 has quit [Quit: https://m6w6.name]
m6w6 has joined #zig
ur5us has quit [Ping timeout: 244 seconds]
gpanders has quit [Quit: ZNC - https://znc.in]
gpanders has joined #zig
casaca has quit [Ping timeout: 256 seconds]
casaca has joined #zig
Biolunar has joined #zig
_whitelogger has joined #zig
FireFox317 has joined #zig
heidezomp has joined #zig
klltkr has joined #zig
knebulae has joined #zig
sam0x17 has joined #zig
<sam0x17> hey is there somewhere I can find some basic info on the SIMD support?
<sam0x17> and also (since I'm unfamiliar with SIMD stuff in general), what is the max size of a SIMD vector and/or at what point do they become too large to be practical?
<sam0x17> also I've been creating them at compile time like this: `const one: @Vector(size, u8) = [_]u8{1} ** size;` however as `size` gets large, the compile time goes up exponentially (at runtime it's fine though)
<ifreund> sam0x17: the idea is that you should use whatever you want and llvm will do The Right Thing. In practice you might want to limit total size of your vectors a power of 2 (e.g. 128 bits)
heidezomp has quit [Ping timeout: 245 seconds]
<ifreund> for making a vector just use @splat(size, 1);
<sam0x17> ok cool
<sam0x17> is it possible to take a slice of a vector and add a vector to that slice?
<sam0x17> (what I want to do is add 1 to a subrange / slice of a vector)
FireFox317 has quit [Ping timeout: 264 seconds]
marnix has quit [Ping timeout: 240 seconds]
<ifreund> not sure I follow, generally you only want to use vectors when you are doing the exact same opreation on all elements
<sam0x17> in my use case, I need to add `1` to all elements after the `ith` position regularly
<sam0x17> I wonder if there is some casting magic that could get me that
<ifreund> sam0x17: here's a messy example https://paste.rs/p5k
<ifreund> dunno if this is actually faster than a non-vector version, you'd have to benchmark
<ifreund> sam0x17: actually, you can @ptrCast the vector directly https://zig.godbolt.org/z/3cnfnd
marnix has joined #zig
riba has joined #zig
marnix has quit [Ping timeout: 240 seconds]
riba has quit [Ping timeout: 256 seconds]
FireFox317 has joined #zig
FireFox317 has quit [Ping timeout: 256 seconds]
pixelherodev has quit [Quit: ZNC 1.6.2 - http://znc.in]
r0bby has quit [Ping timeout: 272 seconds]
r0bby has joined #zig
KoljaKube has joined #zig
waleee-cl has joined #zig
riba has joined #zig
st4ll1 has quit [Quit: WeeChat 2.9]
<KoljaKube> Is it possible to get a function pointer from a TypeInfo.Fn, or in any other way when I have an unknown struct passed to me?
<ifreund> KoljaKube: you can get the name of the function from TypeInfo and then use @field()
<ifreund> (yes @field() works for decls as well as fields)
<KoljaKube> After writing here I remembered builtins and started scanning them, but somehow missed that. Thanks!
<KoljaKube> Why is FnArg.arg_type optional btw? And what is is_noalias about?
riba has quit [Ping timeout: 256 seconds]
marnix has joined #zig
decentpenguin has quit [Quit: ZNC crashed or something]
Akuli has joined #zig
cole-h has joined #zig
pixelherodev has joined #zig
<sam0x17> ifreund thx!!
cole-h has quit [Quit: Goodbye]
<pixelherodev> andrewrk: ohhh, i think I get it; allocateDeclIndexes sets aside space in the GOT for each symbol, allowing calls to be emitted before the function itself, which is why it's useful for parallelizing incremental compilation?
xackus has joined #zig
ur5us has joined #zig
marnix has quit [Ping timeout: 265 seconds]
dingenskirchen has joined #zig
dingenskirchen has quit [Client Quit]
Akuli has quit [Quit: Leaving]
wootehfoot has quit [Read error: Connection reset by peer]
radgeRayden has quit [Ping timeout: 272 seconds]
sam0x17 has quit [Ping timeout: 245 seconds]