News for hackers. Stuff that matters.
Re:Async-await on stable Rust by phamilton on Thursday November 07, 2019 @12:51PM (#21475432)
But whether a function is not async-safe is pretty black and white (i.e. there's a lot of clearly unsafe code). Even a definition as simple as "performs blocking I/O" would be extremely helpful.

This is the value people get out of async only environments like node. Yes, you still have to worry about costly for loops but I don't have to worry about which database driver I'm using because they are all async. In a mixed paradigm language like rust I would really appreciate the compiler telling me I grabbed the wrong database driver.

Re:Async-await on stable Rust by nicoburns on Thursday November 07, 2019 @01:30PM (#21475874)
What about long-running computations? They're not really async-safe (they will block the thread), but they don't perform any IO.
Re:Async-await on stable Rust by yazaddaruvala on Friday November 08, 2019 @02:43AM (#21480581)
I think the suggestion is “clearly blocking io should be marked as such (with some marker like unsafe) and other functions can be marked “blocking” if the creator decides it is blocking.”

In the worst case a problem could still occur, but once found, the “problem” function can be marked appropriately. At the least that would start to solve the issue.

Re:Async-await on stable Rust by leshow on Thursday November 07, 2019 @01:20PM (#21475757)
There are plenty of synchronous calls in node and js. Not everything is async https://nodejs.org/api/fs.html#fs_dir_readsync

And that's just io, most function calls are synchronous also