3 ms·
Rust meets the web – a clash of programming paradigms (2020)
- shwestrick 5y agoIn the "Race Conditions? Not with Javascript!" section: > They [...] decided that no concurrency between threads is allowed, for the safety of everybody. This resolves the race conditions by removing the possibility that multiple threads ever run at the same time. Nope! It's very easy to write a JS program with a race condition. Like this one, which sometimes outputs 0, sometimes 1: var a = 0; setTimeout(function() { a = 1; }, 50); setTimeout(function() { console.log(a); }, 49);
- CodesInChaos 5y agoThe article should have talked about data races, which are narrower than race conditions.
- otabdeveloper4 5y agoYeah, back when I was debugging frontend bugs it seemed like at least 60% of them were race condition bugs. (It seems there's always at least one whenever a function depends on an XHR request's result.)
- jvanderbot 5y agoCalling a race close ("marginal difference ") when one program had 1/6 the runtime of the other seems a little disingenuous. But why are people interested in rust on client side web? Does front end development need yet another paradigm?