Popcorn v1.0 is out and runs on the BEAM

Popcorn, the library that runs Elixir code in the browser, is now stable :popcorn:

This is possible because it now builds on a very stable foundation: the BEAM itself. Until now, Popcorn was based on AtomVM, a tiny Erlang VM designed for limited environments such as microcontrollers or WASM.
It turns out WASM is not as limited as we thought, and it can run the BEAM just fine! That means Popcorn is now compatible with the BEAM and can run the latest Elixir/OTP versions.
The switch also gave us better stability and performance, while the VM fits in 1 MB gzipped and has the potential to shrink even further.

More in the blog post: Popcorn 1.0: Moving from AtomVM to OTP/BEAM

Also, there’s a new website :wink:

Happy hacking!

43 Likes

:exploding_head:

This seems like it could open up a lot of interesting possibilities!

3 Likes

Are there any other Nix users here who are blocked at the point of getting the precise patch version of OTP?

This has happened again and again.
popcorn machine is out of order.

Through the nix-beam-flakes package:

   error: attribute '"29.0.6"' missing
   Did you mean one of 24.0.6, 29.0.1, 29.0.2, 29.0.3 or 29.0.4?

Through normal nixpkgs BEAM:

** (Mix) Packaging failed: %{code: "unsupported_otp", runtime: "29.0.6", host: "29.1.2"}
** (Mix) Initial Popcorn cook failed

Can you try 29.0.4?

Hello! The “the ten-second boot was an easily resolved issue[2]” hyperlink doesn’t work.

1 Like

Seems like our CRM doesn’t like footnotes. They’re all at the bottom.

This is cool! I looked at Popcorn when it was on AtomVM and that did not fit my need, so I started building BEAM.com. Glad that WASM is now a good candidate to make the BEAM more accessible.

1 Like

I’m using NixOS and I’ve got the same issue as yours.

Very cool :slight_smile:
Do you have a list of excuses we can use to play with Popcorn?

1 Like

Thanks for reporting! The VM version in the error (29.0.6) is the version that Popcorn runs. As long as you have OTP 29.0.* on the host, it should work as expected. The fix to make this more clear is underway. Support for more OTP versions will come with the next release.

Not really, but if you figure something out we can put it in the docs :sweat_smile:

2 Likes

Popcorn 1.0.1 just landed. It’s compatible with OTP 29.1.*, so there should be no more problems with installation on Nix, cc @c4lliope , @liamtsuyoshi

3 Likes

v1.0 looks really cool! And I wonder, could it be used for a decentralised network? If we can have the power of the BEAM in a browser, pretty much every person on this planet could help host a decentralised censorship-free site by simply keeping a tab open :007:

Could be perfect for: Anyone interested in a protest site built in Elixir? :003:

3 Likes

Theoretically it could work, we could have a P2P network running over WebRTC :grinning_face: I have some serious concerns about pulling it off in practice tho :laughing:

2 Likes

My wish is a server-less Livebook.

5 Likes

3 posts were merged into an existing topic: Anyone interested in a protest site built in Elixir?

I don’t know what I can use this for just yet, but it is brilliant!

1 Like

Here is the example on Cloudflare Workers: https://livebook.fifo.workers.dev/

This is cool; however, it still depends on a server side. I want something that can completely run off-line.

It can! Here is a LiveBook running on GitHub Pages, which is static site hosting: BEAM.com in Livebook

That means we can just open the HTML locally, offline. Or you can have a single livebook.com file that can run in any OSes. That’s what BEAM.com does. It compiles your Erlang or Elixir project into either a single file, or a WASM that can runs BEAM in the browser.

1 Like