12 ms·
I should revise that: "programmers aren't very good at deciding whether a function should be a subroutine or coroutine." Specifically, the problem is that maki
by ben509 7y ago
I should revise that: "programmers aren't very good at deciding whether a function should be a subroutine or coroutine."
Specifically, the problem is that making the decision happen requires refactoring and that can make a small change into a big one. My contention is that for some languages (probably not Rust) it would be beneficial if this didn't impact the code structure heavily.
I've seen smart people simply avoid trying to use asynchronous code in Javascript because it "poisons" the whole stack. Part of this was because it was based on promises, and it meant going through a bunch of logic and refactoring. Arguing against my case, that did result in a slightly nicer structure overall.
Hopefully having proper async / await notation avoids 99% of that mess in Rust by making it a matter of decorating code with the appropriate keywords and being a bit more thoughtful about structure.
And you're obviously right that Rust needs to have sane performance characteristics, let alone being able to export C compatible bindings.