Internals of the async/await pattern from first principles
1–10 of 17 posts
Re: Internals of the async/await pattern from first principles
#2Re: Internals of the async/await pattern from first principles
#3Re: Internals of the async/await pattern from first principles
#4Which programming language is that?
// We're using an imaginary programming language here.
Sadly, not answering the 'why'.
Re: Internals of the async/await pattern from first principles
#5Which programming language is that?
First comment in the first example says: // We're using an imaginary programming language here. Sadly, not answering the 'why'.
Re: Internals of the async/await pattern from first principles
#6Earlier quoted context omitted.
First comment in the first example says: // We're using an imaginary programming language here. Sadly, not answering the 'why'.
I think it's actually a good move here, using a real language would invite too many comments getting caught in the weeds along the lines of: "actually the language does X, Y and Z to implement coroutines which this article skips over"
Re: Internals of the async/await pattern from first principles
#7Which programming language is that?
First comment in the first example says: // We're using an imaginary programming language here. Sadly, not answering the 'why'.
// Set x to 42
x += 42
It's a form of banner blindness.By the way, first I felt a strong Pythonic vibe but then I realized that the colons after the statements were missing. I asked ChatGPT and it said Nim. I opened the Nim homepage and realized that Nim also uses the colons. Then it said it is probably just a form of pseudo-code, and it was right.
I reread the whole article to find the clue but never thought to read the commments. Really weird of me.
P.S. Did you see the mistake in the comment before you got here?
Re: Internals of the async/await pattern from first principles
#8Re: Internals of the async/await pattern from first principles
#9Earlier quoted context omitted.
First comment in the first example says: // We're using an imaginary programming language here. Sadly, not answering the 'why'.
I think it's actually a good move here, using a real language would invite too many comments getting caught in the weeds along the lines of: "actually the language does X, Y and Z to implement coroutines which this article skips over"
Re: Internals of the async/await pattern from first principles
#10Regarding the second code snippet - I've never seen this language feature before. Obviously there are things sometimes called generators implemented as structures, where 'step' or 'next' is just a normal method, but is there a real world example of what is shown?