logoalt Hacker News

_alphageektoday at 11:28 AM1 replyview on HN

The duplicate-state collapse (hoisting the match out of the await branches like in his process_command example) is the single easiest pattern anyone can apply to existing async code today. No compiler work needed, just a refactor.


Replies

zozbot234today at 12:11 PM

At the very least, you'd want to have a custom lint that can surface the places where it's applicable. That's pretty close to compiler work.