ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
darithorn has joined #zig
quc has quit [Ping timeout: 268 seconds]
quc has joined #zig
pdmer has joined #zig
pdmer has quit [Client Quit]
darithorn has quit [Quit: Konversation terminated!]
JinShil has joined #zig
meena has quit [Ping timeout: 245 seconds]
meena has joined #zig
v1zix has joined #zig
v1zix has quit [Quit: Page closed]
kristate has joined #zig
kristate_ has joined #zig
kristate has quit [Read error: Connection reset by peer]
kristate_ has quit [Remote host closed the connection]
kristate has joined #zig
darithorn has joined #zig
kristate has quit [Remote host closed the connection]
kristate has joined #zig
mahmudov has quit [Remote host closed the connection]
darithorn has quit [Quit: Konversation terminated!]
zolk3ri has joined #zig
qazo has joined #zig
davr0s has joined #zig
kristate has quit [Remote host closed the connection]
kristate has joined #zig
kristate has quit [Ping timeout: 256 seconds]
noonien has joined #zig
kristate has joined #zig
JinShil has quit [Quit: Leaving]
<GitHub159>
[zig] kristate opened pull request #1297: [WIP] builtin function @handle() (master...handle-builtin-issue1296) https://git.io/fNupN
kristate has quit [Read error: Connection reset by peer]
kristate_ has joined #zig
kristate_ has quit [Remote host closed the connection]
kristate has joined #zig
kristate has quit [Remote host closed the connection]
very-mediocre has joined #zig
skyfex has quit [Quit: Page closed]
quc has quit [Ping timeout: 256 seconds]
zolk3ri has quit [Remote host closed the connection]
<bheads__>
andrewrk, for a solution to the @handle issue 1297. What if functions could have implicit params. For async function you would have an implicit allocator and handle
<bheads__>
fn <alloc, handle> foo(x: i32) { ... alloc and handle are in scope } ?
<bheads__>
This idea could also be used to control the context a function executes in
bodie__ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
very-mediocre has joined #zig
AndroUser2 has joined #zig
bheads_ has joined #zig
bheads__ has quit [Ping timeout: 244 seconds]
AndroUser2 has quit [Read error: Connection reset by peer]
AndroUser2 has joined #zig
MajorLag1 has quit [Ping timeout: 240 seconds]
noonien has quit [Quit: Connection closed for inactivity]
mahmudov has joined #zig
davr0s has joined #zig
MajorLag1 has joined #zig
bodie__ has joined #zig
bodie__ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
MajorLag1 has quit [Ping timeout: 256 seconds]
<unique_id>
looking at my c++ coroutine stuff from a while back...I have already forgotten how c++ coroutines work :( I have an async_http_write that returns an awaitable type of my own creation, which has an await_suspend method which gets passed a coroutine_handle, and it finally calls an asynchronous write function which takes a lambda, and from it I resume the coroutine
<unique_id>
Maybe learning Zig's coroutines will help me understand C++'s coroutines :)
<unique_id>
and after that I can port my c++ code
<andrewrk>
unique_id, you might want to wait 1 day - I'm in the middle of a really important commit right now, dealing with cancel semantics
<unique_id>
alright :)
<andrewrk>
I'll have a really nice example of file system watching, where std.event.fs.watchFile() returns a Channel
<unique_id>
how useful are stackless coroutines? Have I asked this question before? I mean you're only transforming a single function at the base of a call graph while everything else stays the same, no?
<andrewrk>
they're useful in that you can use event-based programming with async/await syntax, which is huge
<andrewrk>
and it never goes beyond 1 level of indentation
<andrewrk>
most of those try's on async can go away. there's an issue open for that. because when you await something in the same frame as you async it, and the function is comptime known, we can put the coro memory in the calling frame
<andrewrk>
having used them at least in a proof of concept in self-hosted compiler, the stacklessness isn't an issue at all
<unique_id>
okay, awesome
very-mediocre has quit [Quit: Page closed]
<andrewrk>
one note is that the performance gap between debug mode and release-fast mode is bigger
<andrewrk>
the cost for error return traces for normal functions is O(1) and the cost for error return traces for coroutines is O(N) where N is the max number of stack frames we collect (right now hard coded to 30)
<andrewrk>
but iirc that only matters when an error is returned
<andrewrk>
(in release-fast mode error return traces are disabled)
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<unique_id>
agh I missed your stream yesterday, gonna watch it now
<andrewrk>
I think it got pretty dry. also everything I came up with relating to coroutines in that stream I've already tossed out
<andrewrk>
but now I have a notebook with what I believe to be a sound plan
<unique_id>
last time I learned about bash history searching :)
<andrewrk>
ahhh. yes, it's life changing
<andrewrk>
easily saves hours every day
mahmudov has quit [Ping timeout: 256 seconds]
mahmudov has joined #zig
mahmudov has quit [Ping timeout: 256 seconds]
mahmudov has joined #zig
mahmudov has quit [Ping timeout: 244 seconds]
quc has joined #zig
davr0s has joined #zig
mahmudov has joined #zig
zolk3ri has quit [Quit: Lost terminal]
v1zix has joined #zig
zolk3ri has joined #zig
zolk3ri has quit [Quit: Lost terminal]
v1zix has quit [Ping timeout: 252 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<winksaville>
I've created a Message http://bit.ly/2LE0kED that I can add any `BodyType` but I ran into a problem that the Queue class can only handle one type of Node but I'd like it to handle any type.
<winksaville>
I then thought maybe I could use `data: var`, I tried `const Node = struct { data: var };`
<winksaville>
But I get an "error: invalid token: 'var'