Re:Lumen – Elixir and Erlang in the Browser
by johnmarcus on Friday January 24, 2020 @11:21AM
(#22139593)
So you write it in elixer and web assembly converts it to Js that browsers understand. Cool. Just write it in JS and it will probably be faster.
[ Parent
| on HN ]
Re:Lumen – Elixir and Erlang in the Browser
by lawik on Friday January 24, 2020 @11:30AM
(#22139691)
That's not accurate.
WebAssembly is a different beast than JS. As far as I've understood it is executed differently and can do some different things. I don't see any reason why it couldn't be optimized more than JS either, though that's bound to take some time considering the amount of tuning that's gone into JS engines.
More accurately, you write Elixir, it compiles down to Wasm. Wasm is run by your browser as a more machine-friendly format than JS. It may well be faster.