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)

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

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.