JavaScript runtime for the BEAM — Web APIs backed by OTP, native DOM, and a built-in TypeScript toolchain. JS runtimes are GenServers. They live in supervision trees, send and receive messages, and call into Erlang/OTP libraries — all without leaving the BEAM. def deps do [{:quickbeam, "~> 0.7.1"}] end Requires Zig 0.15+ (installed automatically by Zigler, or use system Zig). {:ok, rt} = QuickBEAM.start() {:ok, 3} = QuickBEAM.eval(rt, "1 + 2") {:ok, "HELLO"} = QuickBEAM.eval(rt, "'hello'.toUpperCase()") # State persists across calls QuickBEAM.eval(rt, "function greet(name) { return 'hi ' + name }") {:ok, "hi world"} = QuickBEAM.call(rt, "greet", ["world"]) QuickBEAM.stop(rt) JS can call Elixir functions and access OTP libraries: {:ok, rt} = QuickBEAM.start(handlers: %{ "db.query" => fn [sql] -> MyRepo.query!(sql).rows end, "cache.get" => fn [key] -> Cachex.get!(:app, key) end, }) {:ok, rows} = QuickBEAM.eval(rt, """ const rows = await Beam.call("db.query", "SELECT * FROM users LIMIT 5"); rows.map(r => r.name); """) JS can also send messages to any BEAM process: // Get the runtime's own PID const self = Beam.self(); // Send to any PID Beam.send(somePid, {type: "update", data: result}); // Receive BEAM messages Beam.onMessage((msg) => { console.log("got:", msg); }); // Monitor BEAM processes const ref = Beam.monitor(pid, (reason) => { console.log("process died:", reason); }); Beam.demonitor(ref); Category API Description Bridge Beam.call(name, ...args) Call an Elixir handler (async) Beam.callSync(name, ...args) Call an Elixir handler (sync) Beam.send(pid, message) Send a message to a BEAM process Beam.onMessage(callback) Receive BEAM messages Process Beam.self() PID of the owning GenServer Beam.spawn(script) Spawn a new JS runtime as a BEAM process Beam.register(name) Register the runtime under a name Beam.whereis(name) Look up a registered runtime Beam.monitor(pid, callback) Monitor a process for exit Beam.demonitor(ref) Cancel a monitor Beam.link(pid) / Beam.unlink(...
First seen: 2026-03-29 17:56
Last seen: 2026-03-29 19:57