Favicon of Gleam

Gleam

Gleam is a statically typed functional language for building scalable, fault-tolerant systems on Erlang's BEAM or in JavaScript.

Gleam website screenshot
Gleam GitHub repository preview

Gleam is a statically typed functional programming language that compiles to Erlang and JavaScript. It targets developers who want the reliability and concurrency model of the BEAM runtime (the same runtime that powers Erlang and Elixir) combined with a static type system that catches errors before code ever runs. It's a good fit for teams building distributed, concurrent, or fault-tolerant services who want compile-time safety without giving up access to the Erlang/OTP ecosystem.

The project is written in Rust and distributed as a compiler and toolchain under the Apache-2.0 license. It's community-supported rather than backed by a single company, and funding comes from sponsors rather than a commercial vendor.

Key features

  • Static typing: catches type errors at compile time, reducing a class of runtime bugs common in dynamically typed BEAM languages.
  • Dual compilation targets: code compiles to Erlang bytecode for the BEAM or to JavaScript, letting you share logic between backend and frontend or between server and browser.
  • BEAM interoperability: Gleam code can call into existing Erlang and Elixir libraries, so you're not starting from zero on the ecosystem.
  • Friendly tooling: includes a built-in build tool, package manager, and code formatter as part of the standard workflow.
  • Clear compiler errors: the compiler is designed to produce readable, actionable error messages rather than cryptic type-system output.
  • Functional core: immutable data and pattern matching, in line with the rest of the BEAM language family.

Ideal use cases

Gleam fits well if you're building services that need to run on the BEAM (message queues, chat backends, telecom-style systems, anything needing high concurrency and fault tolerance) but you want static types instead of Erlang's or Elixir's dynamic typing. It also suits teams that want to share business logic between a BEAM backend and a JavaScript frontend, since the same source can target both.

It's a reasonable choice for greenfield projects where you can pick the language and runtime freely, or for teams already on Erlang/Elixir who want to introduce statically typed modules incrementally, since Gleam can interoperate with existing code.

It is not a good fit if you need a mature, large-scale library ecosystem comparable to Elixir's Hex or JavaScript's npm out of the box, since Gleam's own package ecosystem is smaller. It's also not the right choice if your team has no interest in the BEAM runtime and just wants a general-purpose language for, say, systems programming or scripting; other languages are better suited there.

Installation

The README itself doesn't include a step-by-step install guide and instead points to the Gleam website for full instructions and documentation. In practice, since Gleam ships as a compiled binary and the compiler is written in Rust, you have two common paths:

Download a prebuilt binary from the project's GitHub Releases page for your platform and add it to your PATH.

Or build from source with Cargo if you have the Rust toolchain installed:

git clone https://github.com/gleam-lang/gleam.git
cd gleam
cargo build --release

Once the gleam binary is available, you can scaffold a new project and run its build tool:

gleam new my_project
cd my_project
gleam build

Check the official website's install page for platform-specific package manager options (such as Homebrew or asdf) since those aren't detailed in the repository README itself.

Categories:

Share:

Stars
22K
Forks
1K
Last commit
3 days ago
Repository age
10 years
License
Apache-2.0
Self-hosted
No
Activity score
81/100
View Repository
Ad
Favicon

 

  
 

Similar to Gleam

Favicon

 

  
 
Favicon

 

  
 
Favicon