4 ms·
This is a different issue, I was referring more to concurrency using threads/locks vs. channels/goroutines and not to asynchronous I/O. However there is another
by robbrit 13y ago
This is a different issue, I was referring more to concurrency using threads/locks vs. channels/goroutines and not to asynchronous I/O. However there is another point to be made here that helps to present the evolution of languages ;)
To contrast, in Go the async/await keywords are not even needed since asynchronous I/O is handled internally by the runtime; this parallels how the 'delete' keyword from C++ is not needed in Java or C# since the runtime handles deletion of memory. The idea is that the programmer does not even need to think about asynchronous details, it is completely transparent.
For example in Go (pretending that it has an await keyword) there is no difference between this:
data := await socket.Read(...)
and this:
data := socket.Read(...)
Both are asynchronous, but one of them avoids the need to be aware of the difference between synchronous and asynchronous I/O.