The power of a type system, the expressiveness of functional programming, and the reliability of the highly concurrent, fault tolerant Erlang runtime, with a familiar and modern syntax.

import gleam/io

pub fn main() {
  io.println("hello, friend!")
}

Kindly supported by

Reliable and scalable

Running on the battle-tested Erlang virtual machine that powers planet-scale systems such as WhatsApp and Ericsson, Gleam is ready for workloads of any size.

Thanks to its multi-core actor based concurrency system that can run millions of concurrent green threads, fast immutable data structures, and a concurrent garbage collector that never stops the world, your service can scale and stay lightning fast with ease.

pub fn main() -> Nil {
  // Run loads of green threads, no problem
  list.range(0, 200_000)
  |> list.each(spawn_greeter)
}

fn spawn_greeter(i: Int) {
  process.spawn(fn() {
    let n = int.to_string(i)
    io.println("Hello from " <> n)
  })
}

Ready when you are

Gleam comes with compiler, build tool, formatter, editor integrations, and package manager all built in, so creating a Gleam project is just running gleam new

As part of the wider BEAM ecosystem, Gleam programs can use thousands of published packages, whether they are written in Gleam, Erlang, or Elixir.

➜ (main) gleam add gleam_json
  Resolving versions
Downloading packages
 Downloaded 2 packages in 0.01s
      Added gleam_json v0.5.0
➜ (main) gleam test
 Compiling thoas
 Compiling gleam_json
 Compiling app
  Compiled in 1.67s
   Running app_test.main
.
1 tests, 0 failures

Here to help

No null values, no exceptions, clear error messages, and a practical type system. Whether you're writing new code or maintaining old code, Gleam is designed to make your job as fun and stress-free as possible.

error: Unknown record field

  ┌─ ./src/app.gleam:8:16
  │
8 │ user.alias
  │     ^^^^^^ Did you mean `name`?

The value being accessed has this type:
    User

It has these fields:
    .name

Multilingual

Gleam makes it easy to use code written in other BEAM languages such as Erlang and Elixir, so there's a rich ecosystem of thousands of open source libraries for Gleam users to make use of.

Gleam can additionally compile to JavaScript, enabling you to use your code in the browser, or anywhere else JavaScript can run. It also generates TypeScript definitions, so you can interact with your Gleam code confidently, even from the outside.

@external(erlang, "Elixir.HPAX", "new")
pub fn new(size: Int) -> Table



pub fn register_event_handler() {
  let el = document.query_selector("a")
  element.add_event_listener(el, fn() {
    io.println("Clicked!")
  })
}

Friendly 💜

As a community, we want to be friendly too. People from around the world, of all backgrounds, genders, and experience levels are welcome and respected equally. See our community code of conduct for more.

Black lives matter. Trans rights are human rights. No nazi bullsh*t.

a soft wavey boundary between two sections of the website

Lovely people

If you enjoy Gleam consider becoming a sponsor (or tell your boss to)

  • Alex Houseago
  • ZWubs
  • Fabrizio Damicelli
  • Alexandre Del Vecchio
  • Tristan Sloughter
  • Éber Freitas Dias
  • Antharuu
  • Nomio
  • Kristoffer Grönlund
  • Andrii Shupta
  • Mark Rudolph
  • Barry Moore II
  • Danielle Maywood
  • Robert Malko
  • Gabriel Vincent
  • simone
  • Theo Harris
  • Guilherme de Maio
  • Arya Irani
  • Tom Hughes
  • Qdentity
  • Joshua Steele
  • ollie
  • James Birtles
  • Rupus Reinefjord
  • Paul Guse
  • Florian Kraft
  • Scott Wey
  • OldhamMade
  • Ahmad Alhashemi
  • Christopher De Vries
  • CJ Salem
  • Wilson Silva
  • Noah Betzen
  • Adam Johnston
  • Jean Niklas L'orange
  • Damir Vandic
  • Adi Iyengar
  • Guillaume Heu
  • contra1337
  • Sebastian Porto
  • Brad Mehder
  • Bruno Konrad
  • Anthony Scotti
  • Adrian Mouat
  • ggobbe
  • Krzysztof Gasienica-Bednarz
  • John Strunk
  • Jan Skriver Sørensen
  • Geir Arne Hjelle
  • Corentin J.
  • Patrick Wheeler
  • Constantin Angheloiu
  • Chew Choon Keat
  • Sam Aaron
  • Thomas Crescenzi
  •  Aïssata Maïga
  • Ben Myles
  • Graham
  • Emma
  • Richard Viney
  • ad-ops
  • Chris Donnelly
  • Walton Hoops
  • Isaac Harris-Holt
  • Joey Trapp
  • Saša Jurić
  • Sigma
  • Ian M. Jones
  • Benjamin Moss
  • nunulk
  • Chris Rybicki
  • Diemo Gebhardt
  • Cameron Presley
  • optizio
  • Comamoca
  • Nikolas
  • Kuma Taro
  • Jonas Hedman Engström
  • Tim Brown
  • Mark Markaryan
  • Zsolt Kreisz
  • Jean-Adrien Ducastaing
  • Dan
  • Aaron Gunderson
  • Jérôme Schaeffer
  • Johan Strand
  • Felix
  • Sławomir Ehlert
  • Thomas
  • Renato Massaro
  • Rob Durst
  • Grant Everett
  • MzRyuKa
  • Michael Duffy
  • Leon Qadirie
  • Tudor Luca
  • Fede Esteban
  • Dylan Carlson
  • Giovanni Kock Bonetti
  • Mikael Karlsson
  • Marius Kalvø
  • Viv Verner
  • Kevin Schweikert
  • Pedro Correa
  • Lee Jarvis
  • Sammy Isseyegh
  • Bruno Michel
  • Cole Lawrence
  • Redmar Kerkhoff
  • renatillas
  • Ben Martin
  • Tristan de Cacqueray
  • Kemp Brinson
  • Henning Dahlheim
  • Christopher David Shirk
  • Ian González
  • bucsi
  • Justin Lubin
  • Ernesto Malave
  • Michael Mazurczak
  • Giacomo Cavalieri
  • TA
  • Baqtiar
  • Pete Jodo
  • Hubert Małkowski
  • Ivar Vong
  • Timo Sulg
  • Rotabull
  • Dan Strong
  • Carlo Munguia
  • Eric Koslow
  • Jerred Shepherd
  • Niket Shah
  • Olaf Sebelin
  • Andy Young
  • Evaldo Bratti
  • Danny Arnold
  • Russell Clarey
  • Andrea Bueide
  • Martin Rechsteiner
  • Rasmus
  • Zsombor Gasparin
  • Guillaume Hivert
  • Sakari Bergen
  • Dan Gieschen Knutson
  • MoeDev
  • Ed Rosewright
  • tommaisey
  • Reilly Tucker Siemens
  • Sean Cribbs
  • jooaf
  • Filip Figiel
  • Adam Daniels
  • Thomas Coopman
  • Strandinator
  • Jan Pieper
  • Alembic
  • Sean Roberts
  • Stefan
  • Leonardo Donelli
  • Donnie Flood
  • Hannes Nevalainen
  • Jimmy Utterström
  • Joseph Myers
  • Danny Martini
  • Oliver Medhurst
  • David Cornu
  • Leo Ostera
  • Benjamin Kane
  • Max McDonnell
  • Rodrigo Álvarez
  • Jake Wood
  • dagi3d
  • erlend-axelsson
  • Iain H
  • Volker Rabe
  • Billuc
  • John Björk
  • NicoVIII
  • Coder
  • Edon Gashi
  • Tom Schuster
  • N. G. Scheurich
  • André Mazoni
  • Bruce Williams
  • Ajit Krishna
  • Alex Kelley
  • Martin Poelstra
  • Jean-Marc QUERE
  • Seve Salazar
  • Dan Dresselhaus
  • Wundersmiths
  • eli
  • shxdow
  • Lennon Day-Reynolds
  • Sam Zanca
  • Raúl Chouza
  • Tomasz Kowal
  • Bjoern Paschen
  • Stephane Rangaya
  • Erik Terpstra
  • METATEXX GmbH
  • Carlos Saltos
  • Abel Jimenez
  • Stephen Belanger
  • Jon Charter
  • Vassiliy Kuzenkov
  • Christopher Dieringer
  • G-J van Rooyen
  • Jachin Rupe
  • yoshie
  • Isaac McQueen
  • Christopher Keele
  • Hazel Bachrach
  • Natalie Rose
  • Peter Rice
  • Robert Attard
  • Chad Selph
  • Chris Vincent
  • Gavin Panella
  • Oliver Tosky
  • Ameen Radwan
  • Matt Heise
  • Weizheng Liu
  • frankwang
  • Eileen Noonan
  • lidashuang
  • Mark Holmes
  • Valerio Viperino
  • Sgregory42
  • Philpax
  • Will Ramirez
  • Henry Warren
  • Hans Raaf
  • n8n - Workflow Automation
  • ErikML
  • Mario Vellandi
  • David Bernheisel
  • Jake Cleary
  • Steinar Eliassen
  • Robert Ellen
  • Leah Ulmschneider
  • Dylan Anthony
  • Luke Amdor
  • Rico Leuthold
  • Martin Janiczek
  • Kero van Gelder
  • Julian Schurhammer
  • Shawn Drape
  • Jean-Luc Geering
  • Manuel Rubio
  • Ruslan Ustitc
  • Jonas E. P
  • Ethan Olpin
  • Isaac
  • Bjarte Aarmo Lund
  • Scott Zhu Reeves
  • Igor Montagner
  • Nicklas Sindlev Andersen
  • Ed Hinrichsen
  • Christopher Jung
  • Hazel
  • Hari Mohan
  • inoas
  • Cris Holm
  • Comet
  • Yasuo Higano
  • evanasse
  • Lexx
  • Rintaro Okamura
  • Jørgen Andersen
  • Savva
  • Ben Marx
  • Clifford Anderson
  • Joey Kilpatrick
  • Matt Van Horn
  • Matt Savoia
  • James MacAulay
  • Костя
  • Jasmine Tang
  • Adam Brodzinski
  • Jon Lambert
  • Dave Lucia
  • Alexander Stensrud
  • Arthur Weagel
  • Matthew Jackson
  • Fernando Farias
  • Lukas Bjarre
  • Jimpjorps™
  • Ninaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  • Adam Shannon
  • Joseph Lozano
  • Yamen Sader
  • Shritesh Bhattarai
  • Mark Dodwell
  • Andrew Varner
  • Henrik Tudborg
  • Aleksei Gurianov
  • Landon
  • Michael Jones
  • Evan Johnson
  • Ripta Pasay
  • Azure Flash
  • Pattadon Sa-ngasri
  • Brett Cannon
  • Julian Hirn
  • Renovator
  • metame
  • Falk Pauser
  • Samu
  • Constantin (Cleo) Winkler
  • Chris Olsen
  • Hammad Javed
  • Mike Roach
  • Francis Hamel
  • Scott Trinh
  • Natanael Sirqueira
  • Adam Wyłuda
  • Brett Kolodny
  • KamilaP
  • Charlie Govea
  • Chris King
  • Antonio Farinetti
  • Anthony Maxwell
  • Jen Stehlik
  • bgw
  • David Pendray
  • Chris Ohk
  • Michal Timko
  • Brian Glusman
  • Jojor
  • Shane Poppleton
  • Nick Chapman
  • sambit
  • Alex Manning
  • Aboio
  • upsidedowncake
  • Chris Lloyd
  • Cam Ray
  • fruno
  • Matt Mullenweg

You're still here?

Well, that's all this page has to say. Maybe you should go read the language tour!

Let's go!

Wanna keep in touch?

Subscribe to the Gleam newsletter

We send emails at most a few times a year, and we'll never share your email with anyone else.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.