2 ms·
Pseudo-golang with generics func yield[G AnyGenericEvenInterface](promise G) G {...} I'd have preferred the language expand yield() to take an argument which
by mjevans 3y ago
Pseudo-golang with generics
func yield[G AnyGenericEvenInterface](promise G) G {...}
I'd have preferred the language expand yield() to take an argument which yields until the ((promise)d) variable is resolved to a value. This makes it more clear that the work is being passed off to runtime and will wait for that value.
I'm still somewhat confused that promise constructions don't have any well defined start time https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... They could start instantly or defer entirely until waited on by any of the resolution methods. It seems more complex than light threads / goroutines synchronized by communications queues and other first class language objects.