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/
drasko has quit [Remote host closed the connection]
hio has quit [Quit: Connection closed for inactivity]
earnestly has quit [Ping timeout: 265 seconds]
drasko has joined #zig
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 276 seconds]
drasko has quit [Remote host closed the connection]
<hspak> Is there an idiomatic way in zig to splitting a u8 into 2 u4’s? I was thinking of using @truncate with some bitwise operations but was wondering if there was another way
<stratact> fengb: you're not a dumb person. Rust just has a lot of cognitive overhead, as in, one has to think and follow its rules all of the time. Which for me as a former Rust programmer was very stressful and wears me out.
<stratact> I felt like I age faster with Rust
laaron has quit [Remote host closed the connection]
laaron has joined #zig
THFKA4 has quit [Ping timeout: 250 seconds]
laaron has quit [Remote host closed the connection]
laaron has joined #zig
dbandstra has joined #zig
kristoff_it has joined #zig
chemist69 has quit [Ping timeout: 245 seconds]
kristoff_it has quit [Ping timeout: 268 seconds]
<stratact> Is there a way to generate a large statically sized array using the same value for each element in a repeated fashion?
chemist69 has joined #zig
mahmudov has quit [Ping timeout: 240 seconds]
<fengb> [_]T{T.init} ** size
laaron has quit [Remote host closed the connection]
D3zmodos has quit [*.net *.split]
torque has quit [*.net *.split]
gonz_ has quit [*.net *.split]
guan has quit [*.net *.split]
tridactyla has quit [*.net *.split]
odc has quit [*.net *.split]
tracernz has quit [*.net *.split]
torque has joined #zig
gonz_ has joined #zig
guan has joined #zig
odc has joined #zig
D3zmodos has joined #zig
laaron has joined #zig
tridactyla has joined #zig
tracernz has joined #zig
kristoff_it has joined #zig
_whitelogger has joined #zig
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #zig
qazo has quit [Ping timeout: 245 seconds]
laaron has quit [Remote host closed the connection]
laaron has joined #zig
rjtobin has quit [Quit: Leaving]
_whitelogger has joined #zig
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 240 seconds]
dbandstra has quit [Quit: leaving]
porky11 has joined #zig
qazo has joined #zig
qazo has quit [Ping timeout: 265 seconds]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #zig
earnestly has joined #zig
qazo has joined #zig
laaron has quit [Remote host closed the connection]
laaron has joined #zig
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 245 seconds]
mahmudov has joined #zig
porky11 has quit [Ping timeout: 264 seconds]
porky11 has joined #zig
laaron has quit [Remote host closed the connection]
laaron has joined #zig
mahmudov has quit [Ping timeout: 276 seconds]
kristoff_it has joined #zig
Aransentin has quit [Remote host closed the connection]
laaron- has joined #zig
laaron has quit [Remote host closed the connection]
kristoff_it has quit [Ping timeout: 265 seconds]
mahmudov has joined #zig
<stratact> "error: unable to evaluate constant expression" ... 😠
<stratact> If it weren't for that error I might've been able to solve issue #2885
<mq32> stratact: if T.init is comptime, it should work
<mq32> otherwise a for loop will do the work (if .init is known at runtime)
<stratact> mq32: I appreciate it, but T.init wasn't the problem. I suppose I'm trying to, at runtime, set the size of the static array, because I need it to reassign with a new len each time (without allocating because the issue doesn't want the allocator anymore).
<stratact> Sounds like I should go with the for loop approach
<mq32> stratact, is this about storage for a file path?
<mq32> you can use PATH_MAX or similar macros/limits of the OS for this
<stratact> I think it has to do with getting the next Dir entry
<stratact> Here is an example of code I'm trying to refactor without the allocator: https://github.com/ziglang/zig/blob/master/std/fs.zig#L721-L779
<stratact> The problem comes mostly from line 741, where it needs to realloc a new buffer with twice the size
<stratact> I don't know how to emulate that without allocation
<stratact> but whatever the case, andrewrk wants that allocator gone
<mq32> you could make the function take a buffer instead of an allocator
<mq32> and just assume fix-size for the buffer
<stratact> Oh yeah... I can pass a fixed size buffer instead and make it a slice. You're a genius mq32 :)
<mq32> haha
* mq32 bows
<stratact> Usually the simplest solutions are the best ones. I've been banging my head on this for the past couple of days.
<mq32> yeah it's hard to learn to find simple solutions
<mq32> i'm struggling right now in my project and i have a "solution" now that will possibly break horribly
<stratact> 😅
<mq32> hell, i have a type that is *either* reference OR value
<mq32> call that good design! :D
kristoff_it has joined #zig
return0e_ has joined #zig
return0e has quit [Ping timeout: 245 seconds]
kristoff_it has quit [Ping timeout: 268 seconds]
<stratact> mq32: remember when you said it was file path related? It's file path related :)
SimonNa has joined #zig
<mq32> :)
<stratact> unexpected errno: 22
<stratact> /usr/src/lib/csu/amd64/crt1.c:76:7: 0x23610a in _start (/usr/src/lib/csu/amd64/crt1.c)
<stratact> ???:?:?: 0x800320fff in ??? (???)
<stratact> Someone please kill me
<mq32> errno 22 is invalid argument
<mq32> is your buffer too small?
<mq32> if i remember the docs right it is the errno you get when the buffer is too small
<stratact> I see
<stratact> I did try with using MAX_PATH_BYTES and std.mem.page_size, but that's not enough apparently
<stratact> oh boy, how big does this buffer need to be?
<mq32> MAX_PATH_BYTES + sizeof(dirent-structure used) + some buffer i think
<stratact> mq32: I appreciate the help. I need to lie down for a bit. Got a huge headache ;)
<mq32> yeah i got to clean up some stuff here, should do that :D
porky11 has quit [Ping timeout: 245 seconds]
return0e_ has quit [Read error: Connection reset by peer]
return0e has joined #zig
laaron- has quit [Remote host closed the connection]
laaron has joined #zig
laaron- has joined #zig
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron- has quit [Remote host closed the connection]
Yardanico has quit [Remote host closed the connection]
laaron has joined #zig
mahmudov has quit [Ping timeout: 258 seconds]
mahmudov has joined #zig
ofelas has joined #zig
tobbez has quit [Quit: Segmentation vault]
samtebbs has joined #zig
Akuli has joined #zig
return0e_ has joined #zig
return0e has quit [Ping timeout: 268 seconds]
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 265 seconds]
_whitelogger has joined #zig
kristoff_it has quit [Ping timeout: 276 seconds]
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 240 seconds]
Akuli has quit [Quit: Leaving]
laaron has quit [Remote host closed the connection]
laaron has joined #zig
kristoff_it has joined #zig
donpdonp has quit [Quit: The Lounge - https://donp.org/thelounge]
kristoff_it has quit [Ping timeout: 240 seconds]
donpdonp has joined #zig
vegax87 has joined #zig
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 265 seconds]
ltriant has joined #zig
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 268 seconds]
earnestly has quit [Ping timeout: 258 seconds]
vegax87 has quit [Quit: Leaving]
anand-b has joined #zig
anand-b has quit [Remote host closed the connection]
drasko has joined #zig
<Tetralux> Random thought: Why is the alignment argument in Allocator a u29 and not a usize?
<Tetralux> Or a u32, u64, etc.
<fengb> To make it unique?