5 ms·
An often overlooked but very important point is the ease of use of a programming model. NodeJS has build it concurrency model on callbacks which make non-trivi
by touilleMan 6y ago
An often overlooked but very important point is the ease of use of a programming model.
NodeJS has build it concurrency model on callbacks which make non-trivial application difficult to debug and evolve.
Since then new paradigms have emerged such as promises and structured concurrency (https://vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/ https://vorpus.org/blog/notes-on-structured-concurrency-or-g...).
Rust has build it concurrency model with those new paradigms in mind, mixing them with it awesome ownership model.
In the end Rust brings to the table much stronger guarantees on your code consistency compared to NodeJS, which can save you a lot of time and energy on complex concurrent system ;-)
- gnur 6y agoModern node development uses promises as well.
- ShinTakuya 6y agoYeah in fact they were ahead of the game, not to say I don't prefer Rust, but for a long time promises were a pain in Rust compared to node.
- ragnese 6y agoThey weren't more painful in Rust because of them being implemented poorly or anything. Rust's memory model makes referencing data across scopes difficult. In a GC'd language, your closures can just reference everything willy-nilly. Also, I'm not sure, but I think Scala had Futures before bluebirdjs existed, which was the defacto Promise for JS, AFAIK.
- nicoburns 6y agoI'm not sure if they were first and they were API incompatible with modern JS promises, but jQuery had deferred objects in 2011, 2 years before the first Bluebird commit on Github. Bluebird wasn't the first JS Promise library. It became the defacto library because it was faster than everything else. Edit: https://en.wikipedia.org/wiki/Futures_and_promises https://en.wikipedia.org/wiki/Futures_and_promises has a history
- ragnese 6y agoNice. I am certainly not up on my JavaScript history. Bluebird was the first I used and it was still gaining popularity at the time. I do know that promises existed a LONG time ago, I was just referencing languages that still are popular-ish. I thought the Scala implementation was pretty old, but it looks like Java actually has everyone beat.
- filleduchaos 6y ago> NodeJS has build it concurrency model on callbacks which make non-trivial application difficult to debug and evolve. JavaScript has had async/await for four years (and promises for even longer than that). JS has its issues but it's not at all helpful when criticism is badly outdated either.