ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
suirad has quit [Ping timeout: 256 seconds]
suirad has joined #zig
mgxm has left #zig ["WeeChat 2.2"]
williamcol3 has joined #zig
williamcol3 has quit [Ping timeout: 250 seconds]
<daurnimator> hey is it possible to make slices compatible (memory layout-wise) with a struct iov?
basro has quit [Read error: Connection reset by peer]
basro has joined #zig
qazo has joined #zig
reductum has joined #zig
qazo has quit [Ping timeout: 250 seconds]
qazo has joined #zig
qazo has quit [Ping timeout: 245 seconds]
qazo has joined #zig
qazo has quit [Ping timeout: 246 seconds]
reductum has quit [Ping timeout: 246 seconds]
reductum has joined #zig
StateOff has joined #zig
<StateOff> Hi. Is there a way to get the type from *type?
<MajorLag> const X = *T; const Y = X.Child; //Y == T
<MajorLag> or const Y = comptime meta.Child(X);
<StateOff> Great. Will try. So far I got it working with @typeInfo(T).Pointer.child, but this seems like an overkill.
<StateOff> Another one: I try to get a struct's field address (as int) via typeInfo. What I did is @ptrToInt(struct_ptr) + @bitOffset(T, field.name)/8. I wonder if there is an easier way?
<MajorLag> @ptrToInt(&struct.field)
<StateOff> struct in this case is a 'type', and I can't do T.field
<MajorLag> So... if it's a type, what exactly does the pointer represent, since it isn't instantiated?
<MajorLag> You can get the relative offset of a field from the struct using @byteOffsetOf(T, field_name);
<StateOff> Yes that's what I'm doing. It seems a bit weird to ask for these things but I am writing a serializer so I need to introspect structs, follow certain pointers etc.
<StateOff> So for zig's comptime reflection got me pretty far.
<MajorLag> You might want to look at https://github.com/ziglang/zig/pull/1775
qazo has joined #zig
zange has joined #zig
<StateOff> That's great! Thanks for the hint. Thant makes a good reference although my use case will be a bit different.
<StateOff> My stuff allows annotating a struct to handle pointers (Null, follow and serialize to an index, Keep live). Deserializing would relink the pointers based on the index, if they were followed. Live pointers will be just reinstantiated (only works if the app state did not change or the full state was brought back). Nulled pointers expect user handling but may inject some need bombs into the application ;)
<StateOff> Lot's of rope.
wilsonk has quit [Read error: Connection reset by peer]
wilsonk has joined #zig
qazo has quit [Ping timeout: 245 seconds]
wilsonk has quit [Read error: Connection reset by peer]
wilsonk has joined #zig
StateOff has quit [Remote host closed the connection]
reductum has quit [Quit: WeeChat 2.3]
qazo has joined #zig
benjikun has quit [Quit: Lost terminal]
m6w6 has quit [Quit: ZNC - http://znc.in]
qazo_ has joined #zig
qazo has quit [Ping timeout: 245 seconds]
m6w6 has joined #zig
basro has quit [Disconnected by services]
basro has joined #zig
qazo_ is now known as qazo
wilsonk has quit [Ping timeout: 246 seconds]
Zaab1t has joined #zig
qazo has quit [Ping timeout: 268 seconds]
qazo_ has joined #zig
qazo_ has quit [Ping timeout: 240 seconds]
Hejsil has joined #zig
<Hejsil> Seems like llvm can optimize chaining ifs of mem.eql into some kind of statemachine... I have just been really outsmarted by the compiler
<Hejsil> Relevant code: https://godbolt.org/z/-07wYb
meheleventyone has joined #zig
meheleventyone has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
IntoxicatedHippo has joined #zig
Zaab1t has quit [Ping timeout: 250 seconds]
Zaab1t has joined #zig
meheleventyone has joined #zig
meheleventyone has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
meheleventyone has joined #zig
steveno has joined #zig
Hejsil has quit [Quit: Page closed]
hio has joined #zig
IntoxicatedHippo has quit [Quit: Leaving]
qazo has joined #zig
meheleventyone has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
steveno has quit [Ping timeout: 264 seconds]
steveno has joined #zig
Zaab1t has quit [Remote host closed the connection]
Zaab1t has joined #zig
wootehfoot has joined #zig
steveno has quit [Ping timeout: 264 seconds]
meheleventyone has joined #zig
steveno has joined #zig
meheleventyone has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
steveno has quit [Ping timeout: 268 seconds]
Zaab1t has quit [Quit: bye bye friends]
meheleventyone has joined #zig
meheleventyone has quit [Quit: Textual IRC Client: www.textualapp.com]
meheleventyone has joined #zig
meheleventyone has quit [Client Quit]
hio has quit [Quit: Connection closed for inactivity]