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 tasks, fast immutable data structures, and a concurrent garbage collector that never stops the world, your service can scale and stay lightning fast with ease.

fn spawn_task(i) {
  task.async(fn() {
    let n = int.to_string(i)
    io.println("Hello from " <> n)
  })
}

pub fn main() {
  // Run loads of threads, no problem
  list.range(0, 200_000)
  |> list.map(spawn_task)
  |> list.each(task.await_forever)
}

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)

  • Andrea Bueide
  • Sean Cribbs
  • Raúl Chouza
  • Shuqian Hon
  • Thomas Ernst
  • Robert Malko
  • Alexander Stensrud
  • Damir Vandic
  • Michael Jones
  • Christopher Jung
  • Danielle Maywood
  • Tom Schuster
  • Carlos Saltos
  • Fede Esteban
  • Cam Ray
  • MzRyuKa
  • Evan Johnson
  • Nathaniel Knight
  • Matt Savoia
  • Leon Qadirie
  • Savva
  • Ruslan Ustitc
  • Vassiliy Kuzenkov
  • Patrick Wheeler
  • Diemo Gebhardt
  • Adam Brodzinski
  • Natanael Sirqueira
  • Olaf Sebelin
  • Thomas Coopman
  • Ajit Krishna
  • evanasse
  • Rupus Reinefjord
  • Antharuu
  • John Björk
  • Isaac Harris-Holt
  • CJ Salem
  • Carlo Munguia
  • Leonardo Donelli
  • Manuel Rubio
  • Jake Wood
  • Kemp Brinson
  • lidashuang
  • Colin
  • Kramer Hampton
  • John Strunk
  • Georg Hartmann
  • Erik Terpstra
  • Robert Ellen
  • Paul Guse
  • Chris Donnelly
  • Sam Zanca
  • ZWubs
  • sambit
  • Timo Sulg
  • Nikolai Steen Kjosnes
  • Tim Brown
  • Sean Jensen-Grey
  • Jonas E. P
  • Rasmus
  • Race Williams
  • Lee Jarvis
  • Jan Pieper
  • Rotabull
  • Mariano Uvalle
  • Fernando Farias
  • Bjarte Aarmo Lund
  • MoeDev
  • Jimpjorps™
  • Martin Poelstra
  • Pierrot
  • Kevin Schweikert
  • Hubert Małkowski
  • Adrian Mouat
  • frankwang
  • tymak
  • Stefan
  • Joey Kilpatrick
  • KamilaP
  • Scott Trinh
  • Stephen Belanger
  • Tristan de Cacqueray
  • Steinar Eliassen
  • Sigma
  • Hayleigh Thompson
  • Kritsada Sunthornwutthikrai
  • Jean-Marc QUERE
  • optizio
  • Rodrigo Álvarez
  • Charlie Duong
  • Henrik Tudborg
  • Philpax
  • Tomasz Kowal
  • Fabrizio Damicelli
  • Iain H
  • Alexandre Del Vecchio
  • metame
  • Michael Mazurczak
  • Gabriel Vincent
  • Jean-Adrien Ducastaing
  • Bjoern Paschen
  • Francis Hamel
  • Rintaro Okamura
  • Aaron Gunderson
  • Azure Flash
  • Renovator
  • human154
  • Krzysztof Gasienica-Bednarz
  • Evaldo Bratti
  • Cameron Presley
  • Benjamin Moss
  • METATEXX GmbH
  • Alex Houseago
  • martonkaufmann
  • Michael McClintock
  • Nicklas Sindlev Andersen
  • Ed Hinrichsen
  • David Bernheisel
  • Éber Freitas Dias
  • AndreHogberg
  • Justin Lubin
  • Alembic
  • Bruce Williams
  • Anthony Khong
  • Sean Roberts
  • Corentin J.
  • Seve Salazar
  • Mikael Karlsson
  • Brett Cannon
  • Chris King
  • Christopher Dieringer
  • Stefan Hagen
  • Marius Kalvø
  • Comet
  • Hannes Schnaitter
  • Metin Emiroğlu
  • n8n - Workflow Automation
  • Nick Reynolds
  • Jean-Luc Geering
  • Marcos
  • Redmar Kerkhoff
  • Daigo Shitara
  • Tudor Luca
  • Ninaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  • Matthew Whitworth
  • Matt Champagne
  • Dylan Anthony
  • EMR Technical Solutions
  • Graham Vasquez
  • Julian Schurhammer
  • DoctorCobweb
  • Jan Skriver Sørensen
  • Lucas Pellegrinelli
  • Ripta Pasay
  • Jakob Ladegaard Møller
  • Jake Cleary
  • Joshua Steele
  • Ocean
  • Yamen Sader
  • Ethan Olpin
  • Hans Raaf
  • Bruno Michel
  • Brian Dawn
  • Dylan Carlson
  • Tristan Sloughter
  • Leandro Ostera
  • Victor Rodrigues
  • G-J van Rooyen
  • Jon Lambert
  • Danny Arnold
  • Guillaume Heu
  • Jonas Hedman Engström
  • Brad Mehder
  • Brett Kolodny
  • Giacomo Cavalieri
  • gamachexx
  • Lexx
  • Scott Wey
  • eli
  • Sammy Isseyegh
  • Adam Johnston
  • Florian Kraft
  • Anthony Maxwell
  • Ernesto Malave
  • Charlie Govea
  • Cole Lawrence
  • Chris Lloyd
  • Jojor
  • Matt Mullenweg
  • Benjamin Kane
  • Grant Everett
  • Clifford Anderson
  • Niket Shah
  • Jerred Shepherd
  • Adi Iyengar
  • Renato Massaro
  • Mike Roach
  • Scott Zhu Reeves
  • Ameen Radwan
  • Eric Koslow
  • bgw
  • Walton Hoops
  • Ian M. Jones
  • Zsombor Gasparin
  • yoshi~
  • Danny Martini
  • Isaac
  • Xucong Zhan
  • Matt Van Horn
  • Coder
  • Joey Trapp
  • Mark Markaryan
  • Lennon Day-Reynolds
  • OldhamMade
  • Jérôme Schaeffer
  • Brian Glusman
  • Isaac McQueen
  • Luna
  • Guillaume Hivert
  • Sławomir Ehlert
  • Matt Heise
  • Chris Rybicki
  • Valerio Viperino
  • Pete Jodo
  • George
  • Hannes Nevalainen
  • Joseph Lozano
  • Yasuo Higano
  • Saša Jurić
  • Dan
  • Comamoca
  • Henry Warren
  • Reilly Tucker Siemens
  • Strandinator
  • Dillon Mulroy
  • Vic Valenzuela
  • Barry Moore
  • Bartek Górny
  • Jean Niklas L'orange
  • re.natillas
  • James MacAulay
  • Emma
  • Heyang Zhou
  • Ian González
  • Donnie Flood
  • bucsi
  • Felix
  • sekun
  • jooaf
  • Pedro Correa
  • Dennis Dang
  • Abel Jimenez
  • Wilson Silva
  • Geir Arne Hjelle
  • James Birtles
  • Giovanni Kock Bonetti
  • Ben Marx
  • Guilherme de Maio
  • Nick Chapman
  • Aleksei Gurianov
  • ggobbe
  • Kryštof Řezáč
  • Christopher De Vries
  • Ivar Vong
  • Max McDonnell
  • Volker Rabe
  • Igor Montagner
  • tommaisey
  • Mat Warger
  • Ben Martin
  • Ben Myles
  • Robert Attard
  • inoas
  • Leah Ulmschneider
  • Alex Viscreanu
  • Adam Wyłuda
  • Henning Dahlheim
  • Weizheng Liu
  • ollie
  • jiangplus
  • Arya Irani
  • Johan Strand
  • dennistruemper
  • devinalvaro
  • Anthony Scotti
  • David Cornu
  • ad-ops
  • Constantin (Cleo) Winkler
  • Oliver Medhurst
  • Shane Poppleton
  • István Bozsó
  • Theo Harris
  • Michael Duffy
  • Christopher Keele
  • Dima Utkin
  • Jacob Lamb
  • Matt Robinson
  • Alex Manning
  • Chad Selph
  • Kero van Gelder
  • Luke Amdor
  • Peter Rice
  • Georgi Martsenkov
  • Martin Rechsteiner
  • Julian Hirn
  • Willyboar
  • NicoVIII
  • Arthur Weagel
  • Filip Figiel
  • Qdentity
  • Thomas
  • Endo Shogo
  • Christopher David Shirk
  • Jen Stehlik
  • Lukas Bjarre
  • simone
  • Eileen Noonan
  • Nomio
  • Martin Janiczek
  • erlend-axelsson
  • marcusandre
  • Chris Vincent
  • Sam Aaron
  • Mark Dodwell
  • Alexander Koutmos
  • Gavin Panella
  • Mark Holmes
  • Andrew Varner
  • Lily Rose
  • Dan Strong
  • ErikML
  • Viv Verner
  • Dan Dresselhaus
  • Hazel Bachrach
  • Hammad Javed
  • Matthew Jackson
  • Chris Ohk
  • Sebastian Porto
  • Rico Leuthold
  • Chew Choon Keat
  • Oliver Tosky
  • Edon Gashi
  • NFIBrokerage
  • John Pavlick
  • Richard Viney

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.