— And the code calling spawn infact also runs concurrently
So there can be channels of communication across several concurrent functions, without having to return/yield between them
— Why not just use Promise like semantics and fork a function call into a thread, and pass the return value back as the promise's resolv?
Message permanent page
— Why do we need new syntax?
— Do you mean, why do we want to leave the old ways?
— It is not just new syntax
— You can easily write your own promise wrapper over it... it allows far more than this promise behavior
— It is leaving the whole event loop execution model
— Promises aren't needed whatsoever
— It makes them obsolete for async
— Callback hell only existed because we are locked into this event loop model
— And we only ever needed promises to address that