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/
mokafolio has quit [Quit: Bye Bye!]
mokafolio has joined #zig
earnestly has quit [Ping timeout: 246 seconds]
<plumm> has anyone tried linking the Foundation framework and using instance methods for some objects?
<andrewrk> this is getting exciting: https://clbin.com/6tRVr
<andrewrk> all that shit is happening on the thread pool
ur5us_ has quit [Ping timeout: 258 seconds]
<plumm> Actually let me ask this: is there any way to cast c functions?
<andrewrk> plumm, @ptrCast
<plumm> ty
<plumm> now what if I need the cast to have var args o-o
<andrewrk> @ptrCast(fn(...) c_void, ptr)
<plumm> is that anywhere in the docs btw?
<andrewrk> I don't think so
<andrewrk> it's definitely an important detail the docs should mention
<plumm> just wanted to make sure I didn't overlook anything
<plumm> before asking here
<plumm> I was able to do the ptrCast, but zig complained about providing the wrong number of arguments still, womp
<plumm> fwiw: i was trying to use the new objc_msgSend api
waffle_ethics has quit [Ping timeout: 258 seconds]
waffle_ethics has joined #zig
ifreund has quit [Remote host closed the connection]
ifreund has joined #zig
<andrewrk> hmm sounds like an issue on zig's side
cole-h has joined #zig
cryptocode has quit [Ping timeout: 240 seconds]
<daurnimator> plumm: 'new'?
<plumm> well, new to me
<plumm> or its like v2 of the original
WilhelmVonWeiner has quit [Read error: Connection reset by peer]
fireglow has quit [Quit: Gnothi seauton; Veritas vos liberabit]
fireglow has joined #zig
<daurnimator> plumm: IIRC to avoid sending all msgSend calls via a pointer, you need to declare it as an `extern` function multiple times with different signatures
tefter has quit [Ping timeout: 240 seconds]
tefter has joined #zig
dyeplexer has joined #zig
cryptocode has joined #zig
cryptocode has quit [Ping timeout: 246 seconds]
<andrewrk> streaming in 10 min https://www.twitch.tv/andrewrok/
waleee-cl has quit [Quit: Connection closed for inactivity]
semarie has quit [Ping timeout: 240 seconds]
semarie has joined #zig
tughi has quit [Quit: ZNC 1.8.1 - https://znc.in]
tughi has joined #zig
jcmdln has left #zig [#zig]
wilsonk has quit [Read error: Connection reset by peer]
retropikzel has joined #zig
<retropikzel> "expected type 'fn(...) callconv(.C) c_long', found 'fn() callconv(.C) c_long'" What does the ... mean in the first one?
daex has quit [Ping timeout: 265 seconds]
daex has joined #zig
cole-h has quit [Quit: Goodbye]
mikdusan has quit [Read error: Connection reset by peer]
allan0 has quit [Ping timeout: 240 seconds]
mikdusan has joined #zig
allan0 has joined #zig
lemur has joined #zig
tefter has quit [Quit: WeeChat 3.1]
lemur has quit [Quit: Konversation terminated!]
retropikzel has quit [Quit: Leaving]
ur5us_ has joined #zig
retropikzel has joined #zig
earnestly has joined #zig
pretty_dumm_guy has joined #zig
wilsonk has joined #zig
retropikzel has quit [Ping timeout: 250 seconds]
mschwaig has quit [Ping timeout: 252 seconds]
p_____ has joined #zig
dyeplexer has quit [Ping timeout: 268 seconds]
p_____ is now known as dyeplexer
koakuma has quit [Quit: Leaving.]
retropikzel has joined #zig
lemur has joined #zig
lemur has quit [Quit: Konversation terminated!]
lemur has joined #zig
detha has quit [Quit: ZNC - http://znc.in]
detha has joined #zig
cryptocode has joined #zig
mschwaig has joined #zig
ur5us_ has quit [Remote host closed the connection]
ur5us_ has joined #zig
lemur has quit [Quit: Konversation terminated!]
ur5us__ has joined #zig
ur5us_ has quit [Ping timeout: 258 seconds]
ur5us__ has quit [Ping timeout: 240 seconds]
wootehfoot has joined #zig
cryptocode has quit [Ping timeout: 246 seconds]
klltkr has joined #zig
ifreund1 has joined #zig
ifreund2 has joined #zig
cryptocode has joined #zig
ifreund has quit [Read error: Connection reset by peer]
<v0idifyy> error: std.auto_hash.autoHash does not allow slices as well as unions and structs containing slices here (..) because the intent is unclear. Consider using std.auto_hash.hash or providing your own hash function instead. -> std.auto_hash.hash doesn't exist, does anybody know what it is/what it used to be?
ifreund1 has quit [Ping timeout: 260 seconds]
<v0idifyy> funny enough it checks that std.StringHashMap exists on compile time to verify the message makes sense but not std.auto_hash
<v0idifyy> it's std.hash.auto_hash
<v0idifyy> std.hash.auto_hash.hash isn
<v0idifyy> isn't exported..
cryptocode has quit [Quit: leaving]
st4ll11 has quit [Quit: WeeChat 2.9]
st4ll1 has joined #zig
xackus has joined #zig
leon-p has joined #zig
ifreund2 is now known as ifreund
lemur has joined #zig
cole-h has joined #zig
mjsir911 has quit [Quit: Goodbye, World!]
amk has quit [Ping timeout: 240 seconds]
amk has joined #zig
mjsir911 has joined #zig
leon-p has quit [Quit: leaving]
leon-p has joined #zig
leon-p has quit [Read error: Connection reset by peer]
leon-p has joined #zig
mjsir911 has quit [Quit: Goodbye, World!]
mjsir911 has joined #zig
andrewrk has quit [Ping timeout: 240 seconds]
andrewrk has joined #zig
marler8997 has joined #zig
cryptocode has joined #zig
waleee-cl has joined #zig
wootehfoot has quit [Read error: Connection reset by peer]
Barabas has joined #zig
<cryptocode> hey, how do you format var res = try std.math.big.Rational.init(std.testing.allocator);
<cryptocode> err bad paste, format big.Rational as a FP string
Amun_Ra has quit [Ping timeout: 260 seconds]
Amun_Ra has joined #zig
<cryptocode> oh, I guess it doesn't have an arbitrary-precision floating point target, only f64
<cryptocode> is arbitrary precision FP planned for std, or is GMP the way to go for the foreseable future
<ifreund> cryptocode: I don't think it's planned as the self-hosted compiler doesn't need it
<ifreund> comptime_float is defined as having the same precision as the largest concrete float type (f128)
lemur has quit [Quit: Konversation terminated!]
<cryptocode> alright, thanks
leon-p has quit [Quit: leaving]
factormystic has quit [Read error: Connection reset by peer]
factormystic has joined #zig
dyeplexer has quit [Remote host closed the connection]
xackus has quit [Ping timeout: 240 seconds]
xackus has joined #zig
kchambers has joined #zig
<cryptocode> I want to open a file given a relative path, and create it if necessary. So createFileAbsolute obviously wants an absolute path, so I use fs.realpath first. But that returns FileNotFound when the file doesn't exist :) Hints on the right way of dealing with this usecase would be much appreciated.
<ikskuh> cryptocode: std.fs.cwd().createFile("my/relative/dir", .{0)
<ikskuh> and use a makePath(?) earlier
<cryptocode> hm, I'm not used to canonicalization actually checking for file existence
<cryptocode> ikskuh: well, the input may be obsolute or relative, I don't know beforehand
SebastianM has joined #zig
<ikskuh> createFile takes both :)
SebastianM has quit [Client Quit]
<cryptocode> ok, was thinking that would still be relative to cws()
<cryptocode> cwd()*
<cryptocode> so cwd().createFile("/x") is actually from root
<tributarian> I don't have any questions yet, but thanks everyone who has contributed to Zig. I'm digging it so far.
<cryptocode> ikskuh: that's a bit counter intuitive isn't it? To create a file relative or absolute, you have to use cwd first?
<cryptocode> in most languages I ask for the canonical path and then do the open operation
<ikskuh> cryptocode: yeah and that pattern has a hidden failure
<ikskuh> race condition, to be exact
<ikskuh> imho zig has the better way, especially as you are not dependent on CWD
<ikskuh> as in (all?) other languages
<cryptocode> what race condition?
<ikskuh> ah no, i think i messed something up
<cryptocode> the operation is to create the file if doesn't exist, otherwise open it, so non-checking canonicalization first seems fine
<cryptocode> it's fine that realpath mirrors posix semantics, just wondering if there should be a pure path manipulating canonicalize() that doesn't check for path existence
<ifreund> is that std.fs.path.resolve?
<cryptocode> possibly, thanks, will check out
* cryptocode noob
<ikskuh> cryptocode: note that this code might not be portable as WASI doesn't support absolute paths
Akuli has joined #zig
<ikskuh> (which isn't a problem when using dir+relative path)
<cryptocode> yeah, well I still might be given an absolute path, so it must be handled
<cryptocode> on platforms where it's supported
<cryptocode> another reason for canonicalizing first is logging, so I need the full path logged, even if it ends up being permission denied, etc
<cryptocode> ifreund: yep, resolve does exactly what I want
<ikskuh> cryptocode: as said:
<ikskuh> <cryptocode> yeah, well I still might be given an absolute path, so it must be handled
<ikskuh> this is handled by passing in a absolute path to open/createFile
<cryptocode> hm, resolve first makes more sense to me, I need to log the canonical path wheter relative or absolute initally
frmdstryr has joined #zig
<cryptocode> ikskuh: any other WASI quirks related to fs?
<ikskuh> you cannot open arbitrary files i thin
<ikskuh> *think
<cryptocode> thanks
bitmapper has quit [Quit: Connection closed for inactivity]
cryptocode has quit [Ping timeout: 240 seconds]
kchambers has quit [Quit: WeeChat 3.1]
Barabas has quit [Ping timeout: 240 seconds]
Barabas has joined #zig
frmdstryr has quit [Ping timeout: 252 seconds]
Akuli has quit [Quit: Leaving]
pretty_dumm_guy has quit [Quit: WeeChat 3.2-dev]
Barabas has quit [Ping timeout: 240 seconds]
squeek502_ has joined #zig
squeek502 has quit [Ping timeout: 240 seconds]
earnestly has quit [Ping timeout: 240 seconds]