HeadlinesBriefing favicon HeadlinesBriefing.com

How to Package Gleam Apps as Single Executables

Hacker News •
×

Gleam is a functional programming language that compiles to Erlang and JavaScript, featuring Rust-like syntax and Elm-like simplicity. However, it lacks native support for creating standalone executables. This guide explores multiple methods to package Gleam applications into single executables, addressing a key limitation for developers wanting to distribute their Gleam applications.

For Erlang targets, Gleescript creates escripts that run on any system with the Erlang VM installed, though version compatibility matters. Burrito offers an alternative by wrapping applications in self-contained archives without requiring Erlang on the target machine. For JavaScript targets, Deno compile bundles applications with a lightweight runtime, while Node SEA provides experimental single executable support in Node.js v23+. Bun build --compile offers the simplest approach, bundling everything including the Bun runtime into a single executable.

Each method has trade-offs in complexity and requirements. Deno and Bun provide the most straightforward workflows, while Node SEA involves more complex steps including binary manipulation. The choice depends on your target platform and runtime preferences. For developers building Gleam applications, these packaging solutions enable distribution without requiring users to install the full runtime environment.