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/
ur5us has quit [Ping timeout: 240 seconds]
ur5us has joined #zig
heitzmann has quit [Ping timeout: 265 seconds]
heitzmann has joined #zig
rzezeski has quit [Ping timeout: 260 seconds]
rzezeski has joined #zig
nephele_ has joined #zig
nephele has quit [Ping timeout: 240 seconds]
nephele_ is now known as nephele
<andrewrk> ronsor, it's definitely possible to get stack traces working in freestanding/uefi. you'll have to override the default panic handler
waleee-cl has quit [Quit: Connection closed for inactivity]
frmdstryr has quit [Ping timeout: 240 seconds]
cole-h has joined #zig
marnix has joined #zig
AshOhms has joined #zig
AshOhms has quit [Remote host closed the connection]
craigo has quit [Ping timeout: 256 seconds]
ur5us has quit [Ping timeout: 260 seconds]
marnix has quit [Ping timeout: 258 seconds]
wjlroe has quit [Ping timeout: 260 seconds]
guan has quit [Ping timeout: 240 seconds]
cole-h has quit [Quit: Goodbye]
guan has joined #zig
wjlroe has joined #zig
_Vi has joined #zig
ur5us has joined #zig
decentpe- has joined #zig
decentpenguin has quit [Ping timeout: 240 seconds]
decentpe- is now known as decentpenguin
ur5us has quit [Ping timeout: 260 seconds]
mokafolio has quit [Quit: Bye Bye!]
mokafolio has joined #zig
mokafolio has quit [Quit: Bye Bye!]
mokafolio has joined #zig
mokafolio has quit [Client Quit]
mokafolio has joined #zig
<cr1901_modern> ifreund: Thank you! That was the correct answer :D! Hopefully, I'll get the hang of that eventually.
mokafolio has quit [Quit: Bye Bye!]
<cr1901_modern> AFAICT, when a binding is created, the "*" means "make the mutable" rather than "this is a pointer", and Zig doesn't guarantee whether you receive a pointer to the object or it's in registers or by stack ptr offset etc
mokafolio has joined #zig
_Vi has quit [Ping timeout: 240 seconds]
mokafolio has quit [Quit: Bye Bye!]
mokafolio has joined #zig
ur5us has joined #zig
gazler has joined #zig
<ifreund> cr1901_modern: my understanding is that |foo| is similar to passing by value and |*foo| is passing by pointer
<ikskuh> ifreund is correct. |*foo| guarantees pass-by-pointer, you receive a pointer type then
<ifreund> passing by value in zig always means that the value is immutable
<cr1901_modern> >Zig may choose to copy and pass by value, or pass by reference, whichever way Zig decides will be faster.
<cr1901_modern> Oh, this only works for "foo", not "*foo"
<ifreund> exactly
<ifreund> I'm using "pass by value" do describe the semantics, the compiler may optimize things
cren has joined #zig
ky0ko has quit [Quit: killed]
ky0ko has joined #zig
marnix has joined #zig
cren has quit [Quit: Swirc IRC client]
_Vi has joined #zig
ur5us has quit [Ping timeout: 244 seconds]
<protheory8-new-m> > The Zig Standard Library implements an event loop that multiplexes async functions onto a thread pool for M:N concurrency.
<protheory8-new-m> How do I turn this on?
<ikskuh> add "pub const io_mode = .evented_io;" to your main file i think
<Nypsie[m]> In your root file, define pub const io_mode = .evented;
<ikskuh> ah dang D
<Nypsie[m]> :)
<protheory8-new-m> Cool, why does `io_mode` activate it though?
<protheory8-new-m> Do I need to use async IO functions from standard library in my async functions to use this event loop or something?
<ikskuh> there's code in std/start.zig that will check this variable and enable certain behaviours based on that
<ikskuh> no, all standard abstractions should be async aware already
marnix has quit [Read error: Connection reset by peer]
<protheory8-new-m> Yeah but, if I have an async function that doesn't call any other async functions at all, will it still be multiplexed onto a thread pool for M:N concurrency after I do `pub const io_mode = .evented;`?
<ikskuh> no
<ikskuh> async doesn't do magic in zig
<ikskuh> if a function does suspend, it requires a plan to be resumed
<ikskuh> std io functions have the plan to be resumed by the event loop eventually
<protheory8-new-m> OK, thanks
<ikskuh> you should read some of the event loop code to answer those questions, there may be a way to do that though
<protheory8-new-m> Kinda confused when should async functions suspend then
<protheory8-new-m> Where can I read that event loop code?
<ikskuh> std/event.zig and std/event/loop.zig
<ikskuh> functions suspend when they call suspend or call a function that calls suspend
<ikskuh> or when a function uses await
<protheory8-new-m> I know that, but when does function want to call suspend?
<ikskuh> sorry, i don#t fully understand that question
<ikskuh> suspend will yield control flow back to the caller of the function
<ikskuh> so it can be resumed later
<ikskuh> functions want to call suspend when they have triggered a task that can be done asynchronously (like reading from a file)
<ikskuh> do i see it right that it's not yet possible to send stdin to a std.build.RunStep?
waleee-cl has joined #zig
Biolunar has joined #zig
Stephie has quit [Quit: Fuck this shit, I'm out!]
Stephie has joined #zig
ave_ has quit [Quit: o/ https://thelounge.lasagna.dev]
lunamn has quit [Quit: o/ https://thelounge.lasagna.dev]
linuxgemini has quit [Quit: o/ https://thelounge.lasagna.dev]
ave_ has joined #zig
lunamn has joined #zig
linuxgemini has joined #zig
riba has joined #zig
cren has joined #zig
LanceThePants has quit [Read error: Connection reset by peer]
sawzall has joined #zig
riba has quit [Ping timeout: 256 seconds]
<fengb> Suspend is an independent concern from the event loop
xackus has joined #zig
Snetry has quit [Ping timeout: 265 seconds]
Snetry has joined #zig
cren has quit [Ping timeout: 246 seconds]
dingenskirchen has quit [Ping timeout: 240 seconds]
jzelinskie has quit [Ping timeout: 240 seconds]
euantorano has quit [Ping timeout: 240 seconds]
drewr has quit [Ping timeout: 240 seconds]
dddddd has quit [Ping timeout: 240 seconds]
kushalp has quit [Ping timeout: 240 seconds]
kwilczynski has quit [Ping timeout: 240 seconds]
_Vi has quit [Ping timeout: 240 seconds]
nephele has quit [Ping timeout: 240 seconds]
iwq has quit [*.net *.split]
mgxm has quit [*.net *.split]
blueberrypie has quit [*.net *.split]
heitzmann has quit [*.net *.split]
ofelas has quit [*.net *.split]
jicksaw has quit [*.net *.split]
yeti has quit [*.net *.split]
[RMS] has quit [*.net *.split]
creationix has quit [*.net *.split]
Amun_Ra has quit [*.net *.split]
pixelherodev has quit [*.net *.split]
marler8997_ has quit [*.net *.split]
shachaf has quit [*.net *.split]
signop has quit [*.net *.split]
knebulae has quit [*.net *.split]
PC9801 has quit [*.net *.split]
allan0 has quit [*.net *.split]
bbrittain has quit [*.net *.split]
companion_cube has quit [*.net *.split]
nore has quit [*.net *.split]
wjlroe has quit [*.net *.split]
_whitelogger has joined #zig
<fengb> I exist
metheflea has joined #zig
metheflea has quit [Ping timeout: 240 seconds]
metheflea has joined #zig
marnix has joined #zig
<fengb> Maybe not :(
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
<ikskuh> hey fengb
<Nypsie[m]> I acknowledge your existance, fengb
xackus has quit [Ping timeout: 260 seconds]
scriptnull has joined #zig
scriptnull has quit [Ping timeout: 240 seconds]
xackus has joined #zig
mokafolio has quit [Quit: Bye Bye!]
mokafolio has joined #zig
scriptnull has joined #zig
riba has joined #zig
<scriptnull> Hi, I have a question regarding allocators and type casting. Is it possible to allocate an array of u8 and use it to hold a struct (of size less than or equal to the allocated memory) ? If so, how do we cast this array of u8 to the desired struct?
<Nypsie[m]> @bitCast(Struct, bytes) where bytes need to be same size as your struct
<ikskuh> Nypsie[m]: i don't think that's the right solution here
<ikskuh> std.mem.bytesAsValue seems about right
<Nypsie[m]> Ah, maybe a ptrCast then?
<ikskuh> you also need to respect alignment and stuff
<Nypsie[m]> Oh you're right
<Nypsie[m]> std.mem.bytesAsValue() is probably better than, right?
<ikskuh> i think so
<scriptnull> Thanks! I will try std.mem.bytesAsValue() then.
<fengb> If you're talking about allocation, why not use `allocator.create(Struct)`?
xenon44 has joined #zig
cren has joined #zig
<xenon44> Hi, little issue, linking with libc errors: "unrecognized glibc version: 2.32.0". That's the version the system is using, so the issue may not be "missing pattern awareness" as suggested by andrew kelley in an github issue
<xenon44> Does one need to update glibc version as stated somewhere on github?
riba has quit [Ping timeout: 240 seconds]
<fengb> We recently merged that in so it shouldn't be necessary. Did you download the latest?
jayschwa has joined #zig
<xenon44> Yeah, I'm on master
craigo has joined #zig
riba has joined #zig
<xenon44> Sorry for causing you any work/loss of time, found the issue: my stupidity. A dangling symbolic link, pointing to an old build of zig. sorry.
xenon44 has quit [Quit: ERC (IRC client for Emacs 27.1)]
xackus has quit [Ping timeout: 240 seconds]
knebulae has quit [Read error: Connection reset by peer]
knebulae has joined #zig
fraktor has quit [Ping timeout: 265 seconds]
<fengb> We've all been there :P
nvmd has joined #zig
<scientes> if (random()) { }
riba has quit [Ping timeout: 264 seconds]
scriptnull has quit [Remote host closed the connection]
scriptnull has joined #zig
leeward has joined #zig
cren has quit [Quit: Swirc IRC client]
quetzalb has joined #zig
marnix has quit [Ping timeout: 240 seconds]
scriptnull has quit [Quit: scriptnull]
ur5us has joined #zig
cole-h has joined #zig
xackus has joined #zig
<ky0ko_> just updated zig and now i'm getting an error in a codebase that was compiling fine an hour ago: https://paste.sr.ht/~ky0ko/612f363479dba0bdb9ae48c16fb15d550ca23b0c
<ifreund> must be related to the glibc update
<andrewrk> ky0ko, thanks I'll look into this today
<ky0ko_> can be reproduced just by including sys/param.h from c, it looks lie
<andrewrk> can you share your target information?
<ky0ko_> arch linux, x86_64 - need anything more specific than that?
<andrewrk> let me try to reproduce it
<andrewrk> ky0ko, I can reproduce, thanks
nvmd has quit [Quit: Later nerds.]
<ifreund> idk if it helps at all, but my git pull showed that related headers were deleted https://paste.rs/v7y
<andrewrk> hmm yeah looks like that commit needs to be audited
<andrewrk> I'll revert it for now
<andrewrk> ky0ko, that commit is reverted
<ky0ko_> thanks
jayschwa has quit [Remote host closed the connection]
gert_ has joined #zig