Re:Async Rust Is A Bad Language
by anonymoushn on Friday September 08, 2023 @12:54PM
(#37436149)
If someone is foolish enough to implement a websocket library that insists on performing I/O by calling the methods on the language's generic reader and writer interfaces (rather than just operating on buffers the user passes in or whatever), why should they need to implement it a second time to add async? There are plenty of languages in which they do not need to do this, like Python or Lua.
[ Parent
| on HN ]
Re:Async Rust Is A Bad Language
by neonsunset on Friday September 08, 2023 @12:58PM
(#37436202)
How does that relate to async/await? This is an arbitrary implementation choice. Generic reader/writer in Rust wouldn't matter since it will get optimized away, only leaving cooperative multitasking code if the buffer were to be filled by another thread/producer/source.
Re:Async Rust Is A Bad Language
by anonymoushn on Friday September 08, 2023 @01:01PM
(#37436246)
If you write a library that implements websockets on top of the Read trait or on top of sockets, is it *also* an async websocket library, with no additional code and without containing any instances of the async keyword? In many languages the answer is yes.
I guess I should specify that this is true even in a single-threaded context and even without any additional buffers or whatever.