[HN Gopher] Rust meets the web - a clash of programming paradigm...
___________________________________________________________________
Rust meets the web - a clash of programming paradigms (2020)
Author : EMM_386
Score : 19 points
Date : 2021-06-14 11:10 UTC (11 hours ago)
(HTM) web link (www.jakobmeier.ch)
(TXT) w3m dump (www.jakobmeier.ch)
| shwestrick wrote:
| In 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 wrote:
| The article should have talked about _data races_ , which are
| narrower than _race conditions_.
| otabdeveloper4 wrote:
| Yeah, 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.)
___________________________________________________________________
(page generated 2021-06-14 23:02 UTC)