1. 32
    1. 3

      This was really cool. I’ll need to watch that a few times to understand Zig’s callsite behavior. I’ve never seen that design before, but it seems nice to have this kind of flexibility.

      1. In Zig, if you naively wrote an async function and then called it without async, would it behave as expected synchronously?

      2. What are the historical influences on each language’s async design? What was the first language with Zig’s callsite behavior?

      1. 3
        1. Calling without async means that you await the function immediately.
        2. Not sure, but to make this work, Zig uses comptime lazyness a lot and I don’t know of other languages that have that same approach to metaprogramming.

        If you want to read an introductory post to Zig’s Async/Await, I wrote this a while ago: https://kristoff.it/blog/zig-colorblind-async-await/