News for hackers. Stuff that matters.
Re:V8 adds support for top-level await by vore on Tuesday September 24, 2019 @10:24PM (#21066972)
How will you update the bank account with an immutable data structure? You need to mutate the balance somewhere.
Re:V8 adds support for top-level await by jnbiche on Tuesday September 24, 2019 @10:31PM (#21067014)
Well, in practice you're presumably using a database, which has transactions in the API you're using.

But to answer your question, in functional programming (also frequently ReactJS, if you use libraries like Redux), you don't mutate the data structure. You create a new data structure based off the old one.

Am I misunderstanding your question? Just because you use an immutable data structure doesn't mean it can't be updated.

Re:V8 adds support for top-level await by dboreham on Tuesday September 24, 2019 @11:09PM (#21067231)
Database written in not(Javascript) of course, since it has to work and handle concurrency properly.
Re:V8 adds support for top-level await by jnbiche on Tuesday September 24, 2019 @11:25PM (#21067317)
Yes, of course. Why would you build a database in JS?

And does gmail not work well for you?

Most of us are only using JavaScript because that's the only way to build browser applications (or compile-to-JS languages, which still require an understanding of JS or you'll run into problems).

In any case, I don't particularly like JS, so your dig fell short. But JS is necessary for many of us.

Re:V8 adds support for top-level await by zo1 on Wednesday September 25, 2019 @07:27AM (#21069649)
> "Most of us are only using JavaScript because that's the only way to build browser applications (or compile-to-JS languages, which still require an understanding of JS or you'll run into problems)."

The javascript apocalypse is inevitable, we're just yet to reach the tipping point where this hard-requirement to use JS for web/browser applications is no longer there.