News for hackers. Stuff that matters.
Re:Modern Javascript: Everything you missed over the last 10... by yashap on Saturday May 15, 2021 @07:30PM (#27169888)
Node does have worker threads. They’re awkward because no shared memory, lots of serialization overhead and boiler plate, but if you’ve got heavy data processing to do on say a 4-8 CPU machine, you can certainly split it up between 4-8 CPU threads.
Re:Modern Javascript: Everything you missed over the last 10... by SavantIdiot on Sunday May 16, 2021 @12:41PM (#27174871)
That's process parallelism, not compute parallelism. To radically different things.

I've avoided using node worker threads in favor child.fork, which then resolves to IPC through process.on and process.send, which is like any other process management.

Re:Modern Javascript: Everything you missed over the last 10... by hajile on Saturday May 15, 2021 @08:57PM (#27170303)
Node supports SharedArrayBuffer. It’s not perfect, but is usable.

In truth, assemblyscript or rust running in wasm is probably the best solution going forward.

Re:Modern Javascript: Everything you missed over the last 10... by yashap on Saturday May 15, 2021 @09:48PM (#27170533)
True, but regardless, the kind of ergonomic, low overhead parallel computing available in Scala or Go just isn’t possible in Node. In Scala or Go, parallel computing is barely anymore difficult than synchronous computing, in Node it’s quite the pain in the ass once you want to start passing objects with methods and whatnot between threads.