3 ms·
> Instead of marking asynchronous functions, languages should have had us mark synchronous functions […] Although that wouldn’t remove the possibility of bugs w
by wizzwizz4 2y ago
> Instead of marking asynchronous functions, languages should have had us mark synchronous functions […] Although that wouldn’t remove the possibility of bugs when calling a blocking function in async code,
So mark "synchronous" (i.e., non-yielding) and "asynchronous" (i.e., non-blocking). Then we can have the synchronous colour, the asynchronous colour, functions that are both (e.g. pure CPU-bound tasks, like arithmetic), and functions that are neither (e.g. buggy code).