ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
_whitelogger has joined #zig
Ichorio_ has quit [Ping timeout: 245 seconds]
schme245 has quit [Remote host closed the connection]
radgeRayden has quit [Ping timeout: 244 seconds]
steveno has quit [Quit: Leaving]
Avila has quit [Quit: Leaving]
<kristate>
MajorLag: andrewrk: I can rebase #1851, if that helps
<kristate>
andrewrk: btw, can we get a hint about how the values in `hash_const_val` are calculated ?
kristate has quit [Remote host closed the connection]
kristate has joined #zig
fsateler has quit [Read error: Connection reset by peer]
fsateler has joined #zig
noonien has quit [Quit: Connection closed for inactivity]
_whitelogger has joined #zig
<andrewrk>
kristate, literally random. I'm sure the hashing in zig compiler is poor quality and could be improved with minimal effort
<kristate>
andrewrk: hey, ok
<kristate>
andrewrk: in some places we are adding to the base magic number
<andrewrk>
yeah it's not even consistent
<andrewrk>
the hash function could return 0 for all cases and everything would still work, it's just a heuristic
<kristate>
andrewrk: understood, okay.
<andrewrk>
but if the hash is quick to calculate and reasonably distributes values, then it will speed up hash table lookups
<daurnimator>
andrewrk: can probably be made much better in stage2 :)
<daurnimator>
because we can have compile time perfect hashing
<andrewrk>
that's only if you know all the inputs at compile time
Thalheim has quit [Ping timeout: 246 seconds]
darithorn has quit [Remote host closed the connection]
redj has quit [Read error: Connection reset by peer]
jevinskie has joined #zig
nelarius has joined #zig
nelarius has quit [Client Quit]
_whitelogger has joined #zig
schme245 has joined #zig
jevinskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jevinskie has joined #zig
Marumoto has joined #zig
Marumoto has quit [Ping timeout: 244 seconds]
jevinski_ has joined #zig
jevinskie has quit [Ping timeout: 240 seconds]
jevinski_ has quit [Read error: Connection reset by peer]
jevinskie has joined #zig
schme245 has quit [Remote host closed the connection]
Zaab1t has joined #zig
schme245 has joined #zig
schme245 has quit [Remote host closed the connection]
return0e has quit [Ping timeout: 245 seconds]
return0e has joined #zig
Ichorio has joined #zig
jevinskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<andrewrk>
kristate, it's planned for zig to never emit a getelementptr instruction for vectors
<andrewrk>
that's the " compile error for trying to get a pointer to a vector element" checkbox
<andrewrk>
note that vectors of pointers is a different concept
<andrewrk>
and getelementptr on a vector of pointers is 100% ok, that's the same thing as addition on vectors of integers
<andrewrk>
Marumoto, good to know. Once we have a new test in place to cover it, we can close the issue
forgot-password has quit [Ping timeout: 252 seconds]
forgot-password has joined #zig
forgot-password has quit [Client Quit]
Akuli has joined #zig
steveno has joined #zig
steveno has quit [Remote host closed the connection]
<Akuli>
i want to use a function that uses an Allocator, so how can i create an Allocator?
<Akuli>
i'm looking at std/mem.zig and thinking of something like const the_allocator = std.mem.Allocator { .allocFn = somethingLikeMalloc, .reallocFn = somethingLikeRealloc, .freeFn = somethingLikeFree }; but there's probably a better way than doing this all myself?
<Akuli>
neeeeeeeevermind... i found std.heap.c_allocator
darithorn has quit [Remote host closed the connection]
darithorn has joined #zig
wootehfoot has quit [Read error: Connection reset by peer]
<Akuli>
how do i print a formatted message to stderr? i tried (try std.io.getStdErr()).outStream().stream and then try stderr.print("Usage: {} arg\n", program_name); but i get a weird EBADF error
<darithorn>
Akuli: use std.debug.warn
<Akuli>
is that still good if i don't want to debug my program, but i want to write a usage message?
<andrewrk>
Akuli, it's good if you want to ignore potential errors from writing to stderr
<darithorn>
I imagine it'd be just fine. It has debug in the name but it's just a wrapper for writing to stderr.