Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

Elixir runs in your browser. No server. No install.

Run Elixir code directly in your browser. No server required. No installation needed.

Demo

https://elixir-browser-eval.torifuku-kaiou.app/

What is WebAssembly (Wasm)?

WebAssembly is a compact binary format that runs safely inside modern browsers. It lets non-JavaScript languages run in the browser by compiling them into Wasm modules that execute alongside JavaScript.

flowchart LR
    subgraph Browser
        JS[JavaScript] --> JSE[JS Engine]
        WASM[Wasm Module] --> WR[Wasm Runtime]
    end
    ELX[Elixir/Erlang source] --> BEAM[BEAM bytecode]
    BEAM --> AVM[AtomVM compiled to Wasm]
    AVM --> WR
Loading

How it works

flowchart TB
    subgraph Browser
        UI["Textarea + button"]
        JS["Popcorn JS bridge"]
        WASM["AtomVM (Wasm)"]
        AVM["bundle.avm"]
        EVAL["Code.eval_string/3"]
        UI -->|code input| JS
        JS -->|load| AVM
        JS -->|call| WASM
        WASM --> EVAL
        EVAL -->|result| JS
        JS -->|display| UI
    end
Loading

This project uses:

  • Popcorn - A library to run Elixir in browsers via WebAssembly
  • AtomVM - A lightweight Erlang VM for microcontrollers and WebAssembly

Build

This repository contains pre-built artifacts from Popcorn.

git clone https://github.com/software-mansion/popcorn.git
cd popcorn

# Trust mise configuration (required for cloned repositories)
mise trust

# Install required versions (OTP 26.0.2 and Elixir 1.17.3)
mise install

cd examples/eval_in_wasm
mix deps.get
mix popcorn.cook

The static/ directory is deployed to Cloudflare Pages as-is.

Credits

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages