Does the elixir->js compiler exist as a separate project, or is it built into the framework? Is it based on an existing transpiler? How does it compare / contrast to something like gleam (which, AFAIU also let's you transpile elixir to JS)?
Re the Gleam comparison: I don't know Gleam's implementation in detail so someone correct me if I'm wrong, but as I understand it - Gleam compiles to fairly readable JS with a minimal prelude, and deliberately treats the two targets as having different concurrency semantics. It doesn't try to replicate BEAM processes or OTP in JavaScript, instead using JS's native promise-based async. The upside is zero runtime overhead and clean JS interop.
Hologram takes the opposite approach - we're iteratively reimplementing the Erlang runtime in the browser, with the goal of having full semantic parity eventually. The tradeoff is a heavier runtime, but the benefit is that the same Elixir code can run on both server and client with consistent behavior.
As for the WASM bytecode interpreter idea - you'd run into the same problems I described in my earlier comment. Even a minimal interpreter compiled to WASM tends to land in the multi-MB range once you include enough of the runtime to be useful. You still can't touch the DOM from WASM, so every UI update crosses the JS bridge with serialization overhead. You lose the ability to surgically call native browser APIs (like built-in Unicode support) instead of bundling your own. And you lose readable output, which matters for debugging.
Gleam is different in that JS is a first-class target and built into Gleam's compiler, while Hologram is a standalone project.
I worked on a project last year based on Hologram but ran into some minor issues, and other real-life stuff got into the way. I'm looking forward to picking it up again soon as I have some energy to spare.
[1] Being very lazy I immediately gave up of course, but did file a suggestion :) https://github.com/bartblast/hologram/issues/228
On top of that, since the browser platform has different characteristics, you can surgically drop down to native JS functions instead of compiling and bundling everything. For example, things like Unicode code point databases are already built into the browser - no need to ship them in your bundle when you can just call into the native APIs. The compiled output is also readable which helps with debugging.
For web apps generally JS is the better target IMO - you want the smallest possible bundle and the app reacting as quickly as possible on load.
I'm planning on getting into this ecosystem and I'm considering if it's worth it also becoming an expert on Erlang beyond understanding OTP's internals.
I'd even say that the more serious/critical application becomes the more weight shifts toward Erlang. Personally I'd go with Erlang-first, but only because I've accumulated thousands paper cuts from Elixir.
For starters Elixir has much more palatable syntax, though.
Erlang documentation yes, but I VERY RARELY look at Erlang code. The only times I've really done it have been fiddling with an ODBC driver issue, which isn't really supported anymore by OTP, a crash dump maybe twice, and writing a dialyzer wrapper. I've been building elixir systems for over 10 years, and use OTP heavily,
Keeping mind that Erlang exists much longer than Elixir tooling for Erlang is more robust and mature. BUT its tooling revolves around advanced features e.g. hot updates. For webdev Elixir's tooling is capable enough.
And it'll feel less intimidating once you code in elixir, but I still find it more cryptic and less approachable the 3-4 times I've had to splunk into erlang to debug something in the last decade.
value = :erlang.function(a, b, c)
So with that in mind, you can just learn Elixir, use Erlang where you need it for some libraries. Elixir is IMO much nicer to learn, write and use. I think it is worth learning a bit about the underlying systems but I've never felt like I should have put in 10
erlang-only projects before writing larger elixir stuff.It really is that easy. The interoperability between Erlang and Elixir is fantastic and the communities get along well. There has been a long time push from many of the thought leaders that BEAM (the VM that Erlang and Elixir run on) should be a community regardless of language. That way we can share resources.
When I first learned Elixir I spent all my time in Elixir. Erlang has a lot of nice libraries though, so it wasn't uncommon back when I started to reach for one.
It was a pretty gentle learning curve, you can write Elixir with no knowledge of Erlang at all. You can consume Erlang libraries from Elixir with no knowledge of Erlang at all. Then if you are like me, you are curious about how something works and you go read some library code and it's a bit odd but you can mostly get the gist of it. Then over time reading Erlang is easy enough, the prolog inspired syntax is the hardest hurdle to get over, but then you realize how much Erlang and Elixir have in common.