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> byronh__, here is a basic inflate function https://github.com/dbandstra/zigadventure/blob/master/src/util/InflateInStream.zig
<byronh__> Sweet, i will check that out
isd has quit [Ping timeout: 248 seconds]
JinShil has joined #zig
<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
sagecode has quit [Ping timeout: 240 seconds]
clownpriest has quit [Quit: Textual IRC Client: www.textualapp.com]
mahmudov has joined #zig
mahmudov has quit [Ping timeout: 256 seconds]
Perelandric has joined #zig
quc has joined #zig
Perelandric has quit [Ping timeout: 260 seconds]
<ofelas> i "converted" zlib/contrib/puff.c to zig yesterday if anyone finds that interesting, see https://github.com/ofelas/zigtest/blob/master/zlib/puff.zig
<andrewrk> dbandstra, use the || operator
xtreak has joined #zig
<dbandstra> thanks!
davr0s has joined #zig
tiehuis has joined #zig
<tiehuis> olefas: very cool, i did a similar thing a little while back, too, which may be useful to compare: https://github.com/tiehuis/zig-deflate/blob/master/deflate.zig
very-mediocre has joined #zig
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
<tiehuis> oh did i have it the other way around?
<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]
byronh__ has joined #zig
byronh__ has quit [Ping timeout: 276 seconds]
byronh__ has joined #zig
clownpriest has joined #zig
bheads_ has joined #zig
davr0s has joined #zig
bheads__ has quit [Ping timeout: 240 seconds]
Hejsil has joined #zig
<Hejsil> I wrote a GC in Zig. Should I be punished? https://github.com/Hejsil/zig-gc
quc has joined #zig
<clownpriest> very cool!
<Hejsil> It does collect automagicly yet though
<Hejsil> And maybe it shouldn't
<Hejsil> s/does/doesn't/g
quc has quit [Ping timeout: 265 seconds]
Hejsil has quit [Quit: Page closed]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bheads__ has joined #zig
bheads_ has quit [Ping timeout: 256 seconds]
quc has joined #zig
<clownpriest> is there really no way to do a runtime sized stack allocated array?
<very-mediocre> afaik only with slab preallocation
<very-mediocre> or maybe some very shady template-based solution if pass in sized array types as the generic type e.g. [15]u8
<very-mediocre> but this would obviously be horrid
<very-mediocre> and the extent of "runtime" here would be deciding between available sizes determined at compile time
davr0s has joined #zig
clownpriest has quit [Ping timeout: 268 seconds]
mahmudov has joined #zig
<very-mediocre> This idea was so horrid it caused clownpriest to disconnect :)
hoppetosse has quit [Ping timeout: 256 seconds]
clownpriest has joined #zig
<clownpriest> lol sorry, work connection boots me off regularly, it sucks
<clownpriest> but yeh that is not ideal
<very-mediocre> why can't you allocate on the heap?
bheads_ has joined #zig
<clownpriest> i can, just looking for potential speed gains
<clownpriest> want to void paging through memory because i'm following pointers into heap
bheads__ has quit [Ping timeout: 245 seconds]
<very-mediocre> I see
<very-mediocre> Arena seems decent for that, just have one per "domain" and dealloc at an opportune time
<very-mediocre> before it ever gets a chance to get fragmented
<clownpriest> yeah
<very-mediocre> obv. workload dependent, but that's as close as general purpose as possible now i think
hoppetosse has joined #zig
bheads__ has joined #zig
bheads_ has quit [Ping timeout: 260 seconds]
byronh__ has quit [Ping timeout: 245 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
byronh__ has joined #zig
Ichorio has joined #zig
very-mediocre has quit [Ping timeout: 260 seconds]
pianofingers has joined #zig
davr0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<andrewrk> bodie_, I can do the coroutines documentation today :)
davr0s has joined #zig
frmdstryr has quit [Ping timeout: 265 seconds]
frmdstryr has joined #zig
isd has joined #zig
clownpriest has quit [Quit: Textual IRC Client: www.textualapp.com]
jjido has joined #zig
Perelandric has joined #zig
clownpriest has joined #zig
hoppetosse has quit [Ping timeout: 268 seconds]
very-mediocre has joined #zig
<bodie_> bravo
<GitHub28> [zig] andrewrk pushed 1 new commit to master: https://git.io/vhVAf
<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
<bheads_> sweet
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]
Ichorio has quit [Ping timeout: 276 seconds]
<GitHub20> [zig] andrewrk pushed 1 new commit to master: https://git.io/vhwqV
<GitHub20> zig/master 5252566 Andrew Kelley: langref: add coroutines documentation...
frmdstryr has joined #zig
<GitHub139> [zig] andrewrk pushed 1 new commit to master: https://git.io/vhwmq
<GitHub139> zig/master 0a18d53 Andrew Kelley: langref: add orelse keyword to syntax highlighting
byronh__ has quit [Ping timeout: 245 seconds]
clownpriest has joined #zig
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Tobba has joined #zig
hoppetosse has quit [Ping timeout: 264 seconds]
byronh__ has joined #zig
byronh__ has quit [Ping timeout: 255 seconds]
byronh__ has joined #zig
byronh__ has quit [Ping timeout: 240 seconds]
byronh__ has joined #zig
sagecode has quit [Ping timeout: 276 seconds]
isd has quit [Ping timeout: 265 seconds]
JinShil has joined #zig
sagecode has joined #zig
clownpriest has quit [Ping timeout: 256 seconds]
isd has joined #zig
sagecode has quit [Ping timeout: 264 seconds]