Skip to content
Tech News
← Back to articles

Show HN: QuickBEAM – run JavaScript as supervised Erlang/OTP processes

read original get Erlang/OTP Development Kit → more articles
Why This Matters

QuickBEAM introduces a JavaScript runtime integrated into the BEAM ecosystem, enabling developers to run JavaScript as supervised OTP processes with seamless interaction between JS and Elixir/Erlang. This innovation enhances the flexibility and interoperability of the BEAM platform, allowing for more versatile application development and improved performance. It signifies a step forward in unifying different programming environments within the Erlang ecosystem, benefiting both developers and end-users by enabling more dynamic and scalable applications.

Key Takeaways

QuickBEAM

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.

Installation

def deps do [ { :quickbeam , "~> 0.7.1" } ] end

Requires Zig 0.15+ (installed automatically by Zigler, or use system Zig).

Quick start

{ :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 )

BEAM integration

JS can call Elixir functions and access OTP libraries:

... continue reading