Why isn’t everything async ?

96 points RRumpleTeazzer

I‘ve just dabbed into async rust (I know, it’s late to that party - people alread hate async already).

If I understand async correctly, an async fn will get compiled into a state machine, with an anonymous struct managing the stack and anonymous states managing the interface between .await flow. The await mechanic carries down a wake-callback to the async runtime for some low level blocking stuff to use.

Now an async fn without any .await will get compiled into a (trivial) statemachine that only ever produces one state: Ready(Output). Since there is no .await, there is no wake-callback to manage.

So, can’t every function not just be (trivially) async, then get rid of the async/await syntax entirely?