News for hackers. Stuff that matters.
Re:Lumen – Elixir and Erlang in the Browser by derefr on Friday January 24, 2020 @12:29PM (#22140430)
One thing I wasn't able to ascertain from the link: would this run your Erlang code with the semantics of a single-scheduler BEAM node (i.e. concurrently, but not in parallel); or does this use Web Workers to have multiple parallel schedulers?
Re:Lumen – Elixir and Erlang in the Browser by bitwalker on Friday January 24, 2020 @01:48PM (#22141229)
Initially we’re not planning to support multiple schedulers via WebWorkers, but the runtime has support for multiple schedulers generally speaking. Since the compiler can target other platforms, we didn’t want to artificially limit all targets due to any particular target limitations. As far as Wasm is concerned though, once browser support for SharedArrayBuffer returns, then we’d be looking to take advantage of multiple threads.
Re:Lumen – Elixir and Erlang in the Browser by derefr on Friday January 24, 2020 @02:08PM (#22141393)
Then, could a Lumen user do what pre-SMP Erlang did for parallelism, and

1. run multiple nodes on one machine (i.e. manually create Web Workers each with their own copy of Lumen); and then

2. write an erl_dist alternative-carrier protocol driver that uses worker.postMessage()?

Re:Lumen – Elixir and Erlang in the Browser by bitwalker on Friday January 24, 2020 @07:20PM (#22143615)
Sure, I can't imagine any particular reason why that wouldn't work. That said, we don't have distribution implemented yet, since we are focused on a single node in the browser initially; so it depends on which comes first - SharedArrayBuffer being stabilized again in the browsers so we can enable multiple schedulers, or getting distribution implemented thoroughly enough to support the approach you mentioned as a workaround.
Re:Lumen – Elixir and Erlang in the Browser by lawik on Friday January 24, 2020 @12:39PM (#22140519)
I think you can get more info from the video linked there. I don't recall the details but if it isn't Web Workers there might be something in Wasm. I'm pretty sure it's intended to be able to run multiple schedulers. But I'm not the one building it so not sure.