3 ms·
> some synchronous-looking piece of code doesn't run synchronously so some state at the beginning of the function has a different value at the end of the functi
by kjeetgill 5y ago
> some synchronous-looking piece of code doesn't run synchronously so some state at the beginning of the function has a different value at the end of the function
Does function coloring solve this? I don't think it's the case. Python, JS, etc. don't see this issue much because the interpreters tend to be single threaded or have GILs. C#, for instance, would see all the same issues a Java or Go program might with respect to variables changing over time.
- pas 5y agoOh, JS is full of such bugs, because it's trivial to write a loop that fires off async closures (Promises) that capture something by reference, so they then end up trampling all over each other.