2 ms·
That's a bit of nonsense. As far as I know, all functions are sync in go. The fact that they are implemented async in the runtime with an user-space scheduler
by gpderetta 3y ago
That's a bit of nonsense. As far as I know, all functions are sync in go. The fact that they are implemented async in the runtime with an user-space scheduler is irrelevant (you could otherwise make the point that there are truly no sync functions).
If we call the go programming model async, the word has completely lost all meanings.
- SkiFire13 3y agoWhat is the difference between a sync and an async function for you then?
- gpderetta 3y agoAn async function is on CPS form and return it's result via a return continuation. Typically when invoked from a non CPS function it also forks the thread of execution. These days async functions are also typically lazily evaluated via partial evaluation and the return continuation is not necessarily provided at the call site. A sync function provides it's result via the normal return path.