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)

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

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.