ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
atk has quit [Quit: Well this is unexpected.]
atk has joined #zig
<dbandstra>
byronh__, thanks, it was in a subfolder of /usr/lib for some reason
<dbandstra>
is it possible to declare an error type that extends/includes another error type?
<dbandstra>
i have an InflateInStream which operates on a source InStream and i want its "read" callback to include the errors generated by the source read
xtreak has quit [Remote host closed the connection]
xtreak has joined #zig
jjido has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tiehuis has quit [Quit: WeeChat 2.1]
hoppetosse has joined #zig
quc has quit [Ping timeout: 264 seconds]
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
quc has joined #zig
dbandstra has quit [Quit: Leaving]
jjido has joined #zig
<very-mediocre>
Is the lack of a (pointer to object)->property operator intentional?
<very-mediocre>
I find myself doing a lot of explicit dereferencing
<very-mediocre>
(referring to C's -> operator)
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mahmudov has joined #zig
xtreak has quit [Remote host closed the connection]
tiehuis has joined #zig
<andrewrk>
very-mediocre, you can use . for both T and *T
<andrewrk>
if it's [*]T then you would have to do value[0].field. if you were resorting to that it's probably because of @cImport, and you can consider doing a translate-c offline and then fixing up some of the pointer types in function prototypes
tiehuis has quit [Client Quit]
very-mediocre has quit [Ping timeout: 260 seconds]
very-mediocre has joined #zig
xtreak has joined #zig
davr0s has joined #zig
<very-mediocre>
i'd disconnected, just saw your response andrewrk, thanks
<donpdonp>
im trying to do a simple 'actor' setup where each pthread has a queue of actions to perform where other threads have access to push onto the queue. is there a thread-safe ArrayList?
xtreak has quit [Remote host closed the connection]
xtreak has joined #zig
xtreak has quit [Remote host closed the connection]
xtreak has joined #zig
<donpdonp>
question2: given this line of C "struct epoll_event ev;" ev points at memory allocated for the size of 1 epoll_event. I'm not sure how to do the equivalent in zig.
xtreak has quit [Remote host closed the connection]
<donpdonp>
"var event: c.epoll_event = <?>"
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
xtreak has joined #zig
tiehuis has joined #zig
<donpdonp>
okay after reading some more and using --verbose-cimport a lot, its "c.epoll_event{.events = 0, .data = c.epoll_data{.fd=0}}"
<very-mediocre>
in reading the `std` I noticed there's a lot of `const self = @fieldParentPtr` which seems hacky
<very-mediocre>
and you can't call methods like `pub fn readNext(self: *const Self) T { self.pos += 1 }`
JinShil has quit [Read error: Connection reset by peer]
<very-mediocre>
I guess this is a limitation for now, unless someone has found a better way of having a struct reference itself in a non-const way
<very-mediocre>
(the reason you can't call such a "method" is you can't increment a property e.g.`pos` if `self` is a const reference)
<tiehuis>
const isn't analogous to immutable, that is the pointer itself is const and can't change but the member values of a const pointer can be
<tiehuis>
same as in C or javascript
<very-mediocre>
Nonetheless the compiler complains
<very-mediocre>
and does not allow that sort of definition
<very-mediocre>
You'll find `self` is gotten like this pretty often
<tiehuis>
that is to get some pseudo-interface like behavior
<very-mediocre>
Hm, I may be missing something
<very-mediocre>
(seems to be a recurring theme lately)
<very-mediocre>
When you make a call such as MyStruct.function() it passes the first parameter as a *const MyStruct
<tiehuis>
only if MyStruct is declared with var
<tiehuis>
i mean const
<tiehuis>
if it is var it is passed is implicitly cast to const or non-const otherwise
<very-mediocre>
Hm, still complaining, although this may be that bizarre caching issue I was facing
<tiehuis>
i think i see what you mean before, with read taking a *Self
<very-mediocre>
I've had the compiler continue to complain and not notice I updated my code, which has been confusing to say the least
<tiehuis>
it looks like @fieldParentPtr returns a non-const ptr which is probably why it is okay in that InStream example
<tiehuis>
if you have a full example i can try it out and see
<very-mediocre>
Just a sec, just want to make sure if making the struct `var` would work
<very-mediocre>
rather declaring the instance
<very-mediocre>
Well! You're right
<tiehuis>
great!
<very-mediocre>
Thanks a bunch
<tiehuis>
no problem, feel free to ask if anything else comes up
<very-mediocre>
My main issue with discoverability of such mistakes is not related to the language
<very-mediocre>
It's related to my code updates not being picked up by the compiler, I'm using a weird setup with a network drive
<very-mediocre>
If I make fixes the compiler sometimes keeps stale data, so I learn incorrect things, like "changing it to var doesn't work"
<very-mediocre>
The language itself is fantastic, props to andrewrk and contributors like you :)
<tiehuis>
that's odd, the compiler does zero caching at the moment by the way so i presume it is some os level caching?
<very-mediocre>
Yes it's my setup
<very-mediocre>
It's been the source of much grief
<tiehuis>
sounds rough
<very-mediocre>
The worst is the brain damage it causes when trying to learn something
<very-mediocre>
When you try a fix and it still gives you the same complaint... Is just mind numbing
<very-mediocre>
And the fix is correct, but you learn not to do it because of the stale output
<very-mediocre>
(not that i got this one right btw, I didn't know this one, but even after taking your suggestion I had to do several compiles for it to work :) )
xtreak has quit [Remote host closed the connection]
xtreak has joined #zig
sagecode has joined #zig
tiehuis has quit [Quit: WeeChat 2.1]
JinShil has joined #zig
byronh__ has quit [Ping timeout: 240 seconds]
bheads__ has joined #zig
bheads_ has quit [Ping timeout: 248 seconds]
frmdstryr has joined #zig
davr0s has joined #zig
quc has quit [Ping timeout: 256 seconds]
xtreak has quit [Remote host closed the connection]
Janneman has joined #zig
xtreak has joined #zig
xtreak has quit [Remote host closed the connection]
<bodie_>
is there any documentation for Zig coroutines?
Janneman has quit [Ping timeout: 260 seconds]
mahmudov has quit [Ping timeout: 256 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
JinShil has quit [Read error: Connection reset by peer]
<GitHub28>
zig/master 03c16c6 Andrew Kelley: implement @tagName as a switch instead of table lookup...
bheads_ has joined #zig
bheads__ has quit [Ping timeout: 248 seconds]
<bb010g>
tiehuis: If you take a look at https://wiki.archlinux.org/index.php/Patching_packages , you'll see that it shows applying patches like so: `patch -Np1 -i "${srcdir}/eject.patch"`. This is because they're put in the source array, which means they're put in $srcdir before prepare() is executed.
<bb010g>
When you use "$srcdir/../eject.patch", you're depending on the build being performed from a directory where the patches sit above the source directory. This is not required, though, and causes problems when doing things like building from a chroot because unneeded files aren't copied over.
<bb010g>
To fix this, just use the patches that are in $srcdir.
occivink has quit [Ping timeout: 245 seconds]
occivink has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
occivink has quit [Quit: WeeChat 2.1]
occivink has joined #zig
davr0s has joined #zig
<bheads_>
andrewrk, have you thought about streaming or youtubing zig coding sessions?
<andrewrk>
bheads_, yes, in fact I am taking a poll right now on what time would be best
very-mediocre has quit [Ping timeout: 260 seconds]
<bheads_>
+1 for 14 UTC Thursday (I dont have twitter or reddit accounts...)
<andrewrk>
noted
<andrewrk>
looks like I'll be getting up early on thursdays :)
<bheads_>
lol I get in to the office at 7am, so works good for me
<bheads_>
Q: How do you know you work in enterprise software development?
<bheads_>
A: You spend 8 hours + 5 client meetings to fix SQL written by Oracle in 2011 so the price of a pair of sandels is correct on your java web application....
frmdstryr has quit [Ping timeout: 256 seconds]
hoppetosse has joined #zig
clownpriest has quit [Ping timeout: 255 seconds]
Tobba_ has quit [Read error: Connection reset by peer]