Just plain Elixir
Supervisors, GenServers, and any other OTP components just work. The VM runs off the browser's main thread, so a busy process never freezes the page.
Popcorn runs Erlang/OTP in WebAssembly, allowing you to reuse your Elixir code on frontend.
mix install popcornSupervisors, GenServers, and any other OTP components just work. The VM runs off the browser's main thread, so a busy process never freezes the page.
Under 1 MB of compressed Wasm, with around 2.9 MB for Elixir and the OTP standard library. It boots in about 200 ms. Getting there meant cutting what the browser has no use for — native sockets, distribution, dynamic module loading, crash dumps.
Req, Jason, Ecto, even Phoenix Live View compile and run unmodified. The bundler packs your whole dependency closure, so there's nothing to list.
Requests coming from Elixir use fetch() automatically.
Communicate with Elixir processes, exchange data, run JS from Elixir code.
const result =
await popcorn.genserver.call(
"counter",
["add", 1],
);
if (result.ok) {
console.log(result.data);
}You can use familiar Phoenix LiveViews to create local UI. Makes your app work even when the internet connection is spotty.
Learn more →We created Elixir Language Tour for Elixir newcomers. It's a great start to learn functional programming. It covers base types, pattern matching, functions, processes, and OTP patterns. Uses Popcorn under the hood.
Starting the Elixir runtime