4 ms·
The problem isn't 'function' color, it's thread vs coroutines. Go doesn't have a problem with function color because they are all coroutines and can suspend on
by karmakaze 5y ago
The problem isn't 'function' color, it's thread vs coroutines.
Go doesn't have a problem with function color because they are all coroutines and can suspend on any library call.
Java doesn't have a problem calling or waiting on any function, but it does suffer from thread usage if done too much. This is due to a lack of coroutines.
JavaScript/Node somehow decided that the main thread isn't like all the other coroutines. This is the problem. Make them all coroutines as is done in Go, with the same caveat that if the main one exits the 'program' ends, so it should await anything it needs to.