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/
<andrewrk> oh, derp. `noasync` should clearly be renamed to `nosuspend`
<andrewrk> not sure why it took me this long to realize, lol
aerona has joined #zig
Biolunar has quit [Ping timeout: 272 seconds]
Biolunar has joined #zig
reductum has quit [Quit: WeeChat 2.8]
Biolunar has quit [Quit: leaving]
cole-h has quit [Quit: Goodbye]
<fengb> I was wondering about being able to call async functions within noasync
cole-h has joined #zig
<andrewrk> yeah. but with nosuspend it makes sense right?
<andrewrk> finally finished that redisconf talk, now I can get back to self-hosted
<fengb> Makes sense yeah
<fengb> Oh yeah the talk!
<andrewrk> idk why I agreed to do 2 talks. that was stupid
<fengb> 2 talks? When’s the second?
<andrewrk> they both become available on may 12
<andrewrk> if they don't make them publicly available without registering, I'll just upload them to youtube
<andrewrk> I didn't sign any nonexclusivity contract
<fengb> Oh 2 talks the same event? Yowch
<fengb> Are they still live?
<andrewrk> no, pre recorded. both done
foobles has joined #zig
<foobles> how do you make a request for review on github? maybe because I am not part of the "zig team" or something, but there is nobody listed under the "reviewers" tab
kevsmith has quit [Remote host closed the connection]
kevsmith has joined #zig
<andrewrk> foobles, I think the problem here is not lack of process but lack of contributor time (including mine) and adding process doesn't necessarily save time, and in fact can actually remove time, making the problem worse
<andrewrk> you joined at a particularly difficult time when pull requests are piling up a lot, but I promise you I'm working on getting more funding and qualified people to merge PRs. it'll take a while though
nephele_ has joined #zig
<andrewrk> in the meantime there's just going to be a high latency for some PRs, and that's the unfortunate way it goes
nephele has quit [Ping timeout: 246 seconds]
nephele_ is now known as nephele
marijnfs_ has joined #zig
<fengb> Oh boy, sounds like a major announcement soon
marijnfs has quit [Ping timeout: 265 seconds]
ur5us has quit [Ping timeout: 260 seconds]
<foobles> oh alright, thanks andrewrk
<foobles> understood :]
ur5us has joined #zig
dddddd_ has quit [Ping timeout: 260 seconds]
ur5us has quit [Ping timeout: 244 seconds]
ur5us has joined #zig
<foobles> I know you can say `error.foo` to create a new error value
<foobles> of an anonymous error type
<foobles> because it expands to `error { foo }.foo`
<foobles> but then how does just saying `anyerror.foo` work (assuming no other error set defines foo)?
benjif has quit [Ping timeout: 272 seconds]
<foobles> because it seems to behave identically to just `error.foo`
poga has joined #zig
<andrewrk> anyerror is an error set
<andrewrk> ahh here are the links to the talks:
<foobles> andrewrk but are you able to just invent new error values out of nothing with `anyerror`?
<foobles> like is that intended behavior?
<foobles> or does it mean global as in "it contains any possible error at all"
<foobles> and if so, doesn't the fact that `error.foo` and `anyerror.foo` both do the same thing go against the "one obvious way to do things" principle?
<andrewrk> foobles, yes, `anyerror` is the global error set, including all errors
aerona has quit [Remote host closed the connection]
<foobles> ahh, i thought it was just "all errors of error sets in scope"
<andrewrk> they don't do exactly the same thing
aerona has joined #zig
<andrewrk> `@typeOf(error.Foo)` is an anonymous error set with only 1 error in it
<andrewrk> `@typeOf(Foo.Name)` is Foo
<andrewrk> so if you do anyerror.Name then you have the global error set, which will not coerce to a smaller one
<andrewrk> you almost never want that
<foobles> Oh i see
<foobles> but if you have `const Foo = error { foo, bar }`, `error.foo` can coerce to that
<foobles> interesting
<andrewrk> exactly
<foobles> its seems a bit unclear though, an kinda non-obvious. why does `anyerror` support any possible error, and not just the names of already defined error values?
<andrewrk> that's what it is, any defined error values, global to the entire application
<andrewrk> you can still get a safety panic from @intToError(anyerror, x)
<andrewrk> if your argument is that `anyerror.Foo` should not cause a particular error name to come into existence, then I think you may be on to something
<foobles> yeah, that's what im talking about more
<foobles> like it makes sense to be able to do `anyerror.AnythingDefinedInTheProgram`
<foobles> but for it to make new values seems weird
retrhelo has joined #zig
<retrhelo> leave
retrhelo has left #zig [#zig]
retrhelo has joined #zig
aerona has quit [Quit: Leaving]
<fengb> anyerror encompasses itself too. You changed the global set by querying it!
<foobles> right!
<foobles> but thats super weird!
<foobles> and probably not very useful
foobles has quit [Ping timeout: 245 seconds]
xackus_ has joined #zig
retrhelo has quit [Ping timeout: 272 seconds]
cole-h has quit [Quit: Goodbye]
ur5us has quit [Ping timeout: 260 seconds]
metaleap has joined #zig
waleee-cl has quit [Quit: Connection closed for inactivity]
factormystic has quit [Read error: Connection reset by peer]
factormystic has joined #zig
nia has joined #zig
racoon has quit [Quit: ZNC 1.7.5 - https://znc.in]
ifreund has joined #zig
alexnask_ has joined #zig
alexnask has quit [Ping timeout: 272 seconds]
alexnask_ has quit [Ping timeout: 240 seconds]
GreaseMonkey has quit [Ping timeout: 256 seconds]
wootehfoot has joined #zig
ifreund has quit [*.net *.split]
return0e has quit [*.net *.split]
bsrd has quit [*.net *.split]
Flaminator has quit [*.net *.split]
cota has quit [*.net *.split]
terinjokes has quit [Ping timeout: 246 seconds]
ikskuh has quit [Ping timeout: 264 seconds]
mq32 has joined #zig
terinjokes has joined #zig
Flaminator has joined #zig
ifreund has joined #zig
return0e has joined #zig
cota has joined #zig
bsrd has joined #zig
klltkr_ has quit [Ping timeout: 264 seconds]
alexnask has joined #zig
Wolf480pl has quit [Excess Flood]
Wolf480pl has joined #zig
nia is now known as washbear
washbear is now known as racoon
ifreund has quit [Ping timeout: 256 seconds]
fcambus has left #zig [#zig]
ur5us has joined #zig
dddddd has joined #zig
ifreund has joined #zig
slurpie has quit [Ping timeout: 258 seconds]
wootehfoot has quit [Quit: Leaving]
alexnask_ has joined #zig
linuxgemini6 has joined #zig
jaredmm_ has joined #zig
Nilium has quit [Ping timeout: 246 seconds]
gpanders has quit [Ping timeout: 246 seconds]
gpanders has joined #zig
jaredmm has quit [Read error: Connection reset by peer]
johnLate has quit [Ping timeout: 246 seconds]
Nilium has joined #zig
marler8997_ has quit [Ping timeout: 246 seconds]
alexnask has quit [Ping timeout: 246 seconds]
Prf_Jakob has quit [Ping timeout: 246 seconds]
johnLate has joined #zig
so has quit [Ping timeout: 246 seconds]
linuxgemini has quit [Ping timeout: 246 seconds]
linuxgemini6 is now known as linuxgemini
Prf_Jakob has joined #zig
so has joined #zig
Kingsquee has quit [Quit: Konversation terminated!]
drp has joined #zig
alexnask_ is now known as alexnask
drp has quit [Remote host closed the connection]
drp has joined #zig
ur5us has quit [Ping timeout: 244 seconds]
dimenus has joined #zig
mq32 is now known as ikskuh
zfoo has joined #zig
klltkr_ has joined #zig
dimenus has quit [Remote host closed the connection]
zfoo has quit [Remote host closed the connection]
wootehfoot has joined #zig
dimenus has joined #zig
dimenus has quit [Remote host closed the connection]
dimenus has joined #zig
layneson has joined #zig
foobles has joined #zig
dimenus is now known as Guest28289
Guest28289 has quit [Killed (egan.freenode.net (Nickname regained by services))]
dimenus has joined #zig
st4ll1 has quit [Quit: WeeChat 2.8]
dimenus has quit [Client Quit]
drp has quit [Remote host closed the connection]
slowtyper has joined #zig
drp has joined #zig
ky0ko has quit [Read error: Connection reset by peer]
ky0ko has joined #zig
dimenus has joined #zig
drp has quit [Remote host closed the connection]
st4ll1 has joined #zig
dimenus has quit [Killed (verne.freenode.net (Nickname regained by services))]
dimenus has joined #zig
drp has joined #zig
dimenus has quit [Quit: WeeChat 2.8]
dimenus has joined #zig
dimenus has quit [Client Quit]
dimenus has joined #zig
metaleap has quit [Quit: Leaving]
<companion_cube> https://benaiah.me/posts/everything-you-didnt-want-to-know-about-lua-multivals/ <--- heh, good job at explaining why multiple-return is an antifeature
cole-h has joined #zig
chapl has joined #zig
nycex has quit [Remote host closed the connection]
chapl has quit [Remote host closed the connection]
chapl has joined #zig
<oats> it always felt kinda weirdly bolted on in lua
chapl has quit [Remote host closed the connection]
chapl has joined #zig
nycex has joined #zig
waleee-cl has joined #zig
<chapl> Hey! Somebody mind elaborating on what the difference between InStream#read() and InStream#readAll() is?
<alexnask> read may read less bytes than the buffer length
<alexnask> readAll reads until the buffer is full or read() returns 0 bytes read
<andrewrk> operating systems have the concept of "short reads" which unfortunately is sometimes semantically meaningful
<andrewrk> but almost always you want readAll
<chapl> Alright. If I have a buffer with 512 cap, and readAll says aight look, read 234 bytes... are the remaining 278 bytes in the buffer still undefined? I'd assume yes
gazler has quit [Quit: Leaving]
<andrewrk> yes
<chapl> Ok cool. I have never done manual memory management in detail so one more question: People already explained to me that the number how many bytes were read is useful for trimming the buffer down to the amt of bytes read. How'd I do that?
wootehfoot has quit [Read error: Connection reset by peer]
<gpanders> chapl: Allocator.shrink or Allocator.realloc
dimenus has quit [Quit: WeeChat 2.8]
metaleap has joined #zig
dimenus has joined #zig
ifreund has quit [Ping timeout: 246 seconds]
ifreund has joined #zig
dimenus has quit [Quit: WeeChat 2.8]
dimenus has joined #zig
plumm has joined #zig
<plumm> andrewrk: for out streams, is there any way to have a non async write function?
<andrewrk> plumm, the async-ness of the write function depends entirely on the underlying write function of the stream
dimenus has quit [Client Quit]
dimenus has joined #zig
<plumm> damn, so theres no way to write to a socket from a different thread?
ifreund has quit [Ping timeout: 264 seconds]
<andrewrk> you also have the option to use a nosuspend block to assert at runtime that async functions will not suspend
<plumm> I don't quite fully understand async yet, was waiting for the talk for that
<plumm> I only opted to use evented io because thats required for the tcp connection
<andrewrk> if you're using the std lib event loop, I don't see why you would want to write to a socket from a different thread
<andrewrk> it's not required
<andrewrk> you can use blocking I/O with networking just fine
<plumm> I get an error about something WOULDBLOCK
<andrewrk> let me see
<plumm> ok sec
ifreund has joined #zig
<plumm> /Users/haze/zig/build/lib/zig/std/os.zig:2551:61: 0x10579ebb8 in std.os.connect (run) const loop = std.event.Loop.instance orelse return error.WouldBlock;
<andrewrk> plumm, it builds for me and works as expected when I use netcat to send messages
<plumm> :sob: im on darwin
<andrewrk> ah let me slap a -target on there
<andrewrk> it builds for darwin too
<andrewrk> are you getting a compile error or unexpected runtime behavior?
<plumm> runtime i think
<plumm> yeah, runtime
<plumm> on line 8
<plumm> 0.6.0+4cb4097b0
<andrewrk> you get EWOULDBLOCK?
<plumm> ye
<andrewrk> ok I can reproduce this
slurpie has joined #zig
gpanders has quit [Ping timeout: 260 seconds]
gpanders has joined #zig
<tdeo> lol
metaleap has quit [Quit: Leaving]
<plumm> ok explain, i dont think im at that level of programmer yet 😥
<plumm> maybe just not used to those flags
<tdeo> first and last lines of the range
<andrewrk> no domain knowledge required - the values are typo flipped
<plumm> so the if should be above?
<andrewrk> ok I confirmed this fixes it. just a sec
<ifreund> nice one
Biolunar has joined #zig
<andrewrk> plumm, after this https://github.com/ziglang/zig/commit/0a2104689b4c3c686f2268b5053ad38fd01c1d55 which I just pushed to master, your example works for me on macos
<ifreund> i wonder what percentage of all bugs are simple typos as opposed to bad logic/misunderstanding
<plumm> ok lemme checkomundo
<chapl> andrewrk: Mind having a look? This fails with an out of memory error but it should work. The file is 56b in size and the buffer is 1024b. https://gist.github.com/chaplchapl/5f5ee75df0b50e030170ee41ddcc1643
<chapl> The buffer was 1024*
<chapl> "Unable to read network configuration from 'network.json': error.OutOfMemory. Falling back to default."
<plumm> andrewrk: works! thanks :D
<andrewrk> np
<plumm> andrewrk: this however is now failing https://gist.github.com/181d7c9515b81fceb0f4b1cff7e5957a
<plumm> no errors and my program exits :(
dimenus has quit [Quit: WeeChat 2.8]
dimenus has joined #zig
dimenus has quit [Client Quit]
klltkr has joined #zig
<andrewrk> you must be getting error.EndOfStream, then yeah?
klltkr_ has quit [Ping timeout: 264 seconds]
<plumm> if that were the case the parent function (connect) would return without error and the test wouldn't fail :/
klltkr_ has joined #zig
<plumm> e.g i put a debug.warn after the loop that it breaks from but that is never printed
<andrewrk> this is a good chance to learn more about system debugging tools so you can get more introspection into what's happening
<plumm> I tried to use dtrace but its not liking how i remember it, trying to find an alternative now
<plumm> s/liking/working
klltkr has quit [Ping timeout: 240 seconds]
cole-h has quit [Quit: Goodbye]
dimenus has joined #zig
<plumm> and gdb sucks ass on mac os ugh
<ifreund> try lldb? that's the one apple uses i think
<fengb> lldb works decently
cole-h has joined #zig
<plumm> dam lemme try that
<ifreund> i've poked at it a bit on linux but gdb has been better for me on linux so far
<ifreund> but yeah apple uses their own version of the llvm toolchain, including lldb
<dimenus> i wish lldb had a more cgdb like frontend
<plumm> ok everything works i am just big huge dum
<plumm> thanks for the lldb tip that was so smooth
<ifreund> no problem
metaleap has joined #zig
Akuli has joined #zig
<chapl> Somebody mind helping me out by pointing out what I'm doing wrong or why this fails? https://gist.github.com/chaplchapl/55133b81741af389256ec80cc14e0631
<chapl> The 'catch unreachable' is intentional.
<chapl> Oh wait
<chapl> wtf
<chapl> "try array_list.ensureCapacity(math.min(max_append_size, 4096));"
student069 has joined #zig
klltkr__ has joined #zig
metaleap has quit [Quit: Leaving]
klltkr_ has quit [Ping timeout: 272 seconds]
zfoo has joined #zig
<oats> hmm, I was really hoping `&.{ foo, bar }` would work as short syntax for a slice literal :<
pystub has joined #zig
<andrewrk> I think that is likely to be improved to work as
<andrewrk> s/ as//
<andrewrk> I can't think of any reason to not make that work
<plumm> do you have any idea why accessing an outStream() from another thread would cause EXC_BAD_ACCESS?
<tdeo> do you get a backtrace?
<plumm> no :(
<plumm> I only found this out using lldb
<tdeo> `bt` for a backtrace in lldb
<plumm> well yeah there is one but its just startFn -> posixThreadMain -> libsystem_pthread ...
<tdeo> what function does it happen in?
zfoo has quit [Remote host closed the connection]
metaleap has joined #zig
<plumm> i have a function that opens a socket to an address using tcpConnectToAddress, i spawn a thread that has the write outStream and thats where it begins
Hesaam has joined #zig
Hesaam has quit [Ping timeout: 258 seconds]
Chris660 has joined #zig
wootehfoot has joined #zig
mcf has quit [Excess Flood]
mforney has joined #zig
alexnask_ has joined #zig
alexnask has quit [Ping timeout: 272 seconds]
mforney is now known as mcf
alexnask_ is now known as alexnask
chapl has quit [Quit: Leaving]
benjif has joined #zig
gpanders has quit [Ping timeout: 264 seconds]
gpanders has joined #zig
chapl has joined #zig
<chapl> andrewrk: Mind starting a livestream? Would like to see more No-LLVM work :P
<plumm> ^
constptr has quit [Quit: Connection closed for inactivity]
<layneson> ^^
layneson has quit [Quit: WeeChat 2.8]
<chapl> if he'd just respond.. :'D
ifreund has quit [Ping timeout: 256 seconds]
ifreund has joined #zig
dimenus|home has joined #zig
dimenus has quit [Killed (orwell.freenode.net (Nickname regained by services))]
dimenus|home is now known as dimenus
Guest70237 has joined #zig
dimenus has quit [Quit: WeeChat 2.8]
Guest70237 is now known as dimenus
kristoff_it has joined #zig
ifreund has quit [Ping timeout: 246 seconds]
slowtyper has quit [Ping timeout: 246 seconds]
ifreund has joined #zig
Akuli has quit [Quit: Leaving]
slowtyper has joined #zig
ur5us has joined #zig
Chris660 has quit [Ping timeout: 256 seconds]
Kingsquee has joined #zig
metaleap has quit [Quit: Leaving]
wootehfoot has quit [Read error: Connection reset by peer]
ifreund has quit [Ping timeout: 272 seconds]
ifreund has joined #zig
slowtyper has quit [Ping timeout: 260 seconds]
<plumm> hes heads down in work, we must'nt disturb
FireFox317 has joined #zig
<plumm> :^) hi firefox
<waleee-cl> FireFox317 got an upgrade today
<FireFox317> Hey :D
<waleee-cl> (firefox that is)
<FireFox317> andrewrk, quick question, we are debugging some networking code on kristoff_it stream. Do you have time to join? We are not exactly sure what the issue is
<FireFox317> it comes down to the connect function in os.zig, should it be waiting on writable or readable or only on writable?
<oats> is "error" a reserved keyword?
<shakesoda> yes
<tdeo> yes
nycex has quit [Ping timeout: 240 seconds]
nycex has joined #zig
st4ll1 has quit [Ping timeout: 260 seconds]
st4ll1 has joined #zig
<kristoff_it> Hello, during my stream today I discussed with a few people from the Zig community about the idea of doing some kind of Zig virtual meetup in the near future. If you're interested I wrote a (extremely rough) first idea of how it should look like. If you have any comment please feel free to let me know and/or open an issue there: https://github.com/kristoff-it/zig-meetup
FireFox317 has quit [Ping timeout: 264 seconds]
kristoff_it has quit [Ping timeout: 272 seconds]
ifreund has quit [Ping timeout: 246 seconds]
factormystic has quit [Read error: Connection reset by peer]
factormystic has joined #zig
pystub has quit [Ping timeout: 264 seconds]