# Single file Gleam BEAM programs with escript

DevFeed: [Single file Gleam BEAM programs with escript](<https://devfeed.tech/articles/single-file-gleam-beam-programs-with-escript-51510.md>)

Original publisher: [Read original article](<https://gleam.run/news/single-file-gleam-beam-programs-with-escript>)

Author: Louis Pilfold

Published: 2026-06-02T00:00:00Z

Content type: release

Language: en

Sources: [Gleam](<https://devfeed.tech/sources/gleam.md>)

Topics: [Erlang](<https://devfeed.tech/topics/erlang.md>), [Build tool](<https://devfeed.tech/topics/build-tool.md>), [modules](<https://devfeed.tech/topics/modules.md>), [Compilers and Linkers](<https://devfeed.tech/topics/compilers-and-linkers.md>), [Tool](<https://devfeed.tech/topics/tool.md>), [Bun](<https://devfeed.tech/topics/bun.md>)

Tags: [beam](<https://devfeed.tech/tags/beam.md>), [bytecode](<https://devfeed.tech/tags/bytecode.md>), [command-line](<https://devfeed.tech/tags/command-line.md>), [erlang](<https://devfeed.tech/tags/erlang.md>), [file](<https://devfeed.tech/tags/file.md>), [gleam](<https://devfeed.tech/tags/gleam.md>), [modules](<https://devfeed.tech/tags/modules.md>), [v1](<https://devfeed.tech/tags/v1.md>)

## AI overview

Gleam v1.17.0 adds `gleam export escript` for BEAM projects: it compiles the project, checks for a valid `main` function, and packages compiled modules into one executable file for computers with Erlang installed. The release also adds language-server highlighting for variable references, permits `todo` in constants so incomplete code can still be type checked, and improves editor actions and compiler suggestions. Other changes include quieter `gleam dev` output, an outdated-dependency count, better Git detection when publishing from a monorepo, JavaScript pattern-matching optimizations, and fixes for configuration-validation vulnerabilities. The supplied text also describes improved record hovers and code actions for record updates, patterns, operators, and missing modules.

## Source excerpt

Gleam is a type safe and scalable language for the Erlang virtual machine and JavaScript runtimes. Today Gleam v1.17.0 has been published. Gleam Gathering But first: the first videos from the first ever all-Gleam conference have been released! You can view them on the Gleam Gathering YouTube account. The event was a roaring success and loads of fun. Stay tuned for news of the next one in 2027! Right, back to the release coverage. BEAM escripts When running on the Erlang virtual machine Gleam code is compiled to a series of .beam files, each of which contains the bytecode for a single Gleam module. This works fine for programs distributed or installed using package managers, containers, or other such systems, but having many files to share is a little inconvenient for sharing small command-line programs. In the JavaScript world this problem is solved using a "bundler", a program that takes many JavaScript modules and combines them into a single file. This single file can be copied to and run on any computer that has a JavaScript runtime installed (such as NodeJS, Deno, or Bun). Erlang has a similar solution: escripts. Much like a JavaScript bundle, an escript is a single file that contains all the modules of a program in the form of pre-compiled bytecode, and it can be run on any computer that has Erlang installed. The Erlang build tool has a convenient command for creating an escript, but for Gleam programmers the escript creation process has not been as straightforward. This release brings the gleam export escript command, which will compile the project, verify it has a valid main function, and build the escript file from the compiled bytecode. louis ~/src/my_project $ gleam export escript Compiling gleam_stdlib Compiling my_project Compiled in 0.48s Your escript has been generated to /home/louis/src/my_project/my_project. louis ~/src/my_project $ ./my_project Hello from my_project! Highlight references Gleam's language server provides IDE functionality for all edi