Hacker News new | ask | show | jobs
by gnur 2094 days ago
Modern node development uses promises as well.
1 comments

Yeah 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.
They 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.

I'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 has a history

Nice. 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.