<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)
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]