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() {
  let subject = process.new_subject()

  // Spawn a child green thread
  process.spawn(fn() {
    // Send a message back to the parent
    process.send(subject, "Hello, Joe!")
  })

  // Wait for the message to arrive
  echo process.receive(subject, 100)
}

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)

  • John Björk
  • Shawn Drape
  • Falk Pauser
  • Robert Malko
  • Olaf Sebelin
  • Ed Rosewright
  • Jean Niklas L'orange
  • iskrisis
  • Kero van Gelder
  • KamilaP
  • Samu
  • Hazel Bachrach
  • Alex Houseago
  • Kevin Schweikert
  • Chris Vincent
  • evanasse
  • jstcz
  • Lexx
  • frankwang
  • Ram Prasanth Udhaya Baskar
  • Andy Young
  • Nessa Jane Marin
  • Michael Duffy
  • Dylan Anthony
  • Harry Bairstow
  • Valerio Viperino
  • Niket Shah
  • Isaac Harris-Holt
  • Nikolai Steen Kjosnes
  • Djordje Djukic
  • Will Ramirez
  • Isaac
  • Scott Trinh
  • Cole Lawrence
  • Ameen Radwan
  • Dan Strong
  • Timo Sulg
  • Steinar Eliassen
  • Grant Everett
  • Carlos Saltos
  • ZWubs
  • Eric Koslow
  • Ethan Olpin
  • Jan Skriver Sørensen
  • Kemp Brinson
  • Michael Jones
  • Erik Terpstra
  • Constantin (Cleo) Winkler
  • Evaldo Bratti
  • Manuel Rubio
  • Martin Poelstra
  • Mario Vellandi
  • Natalie Rose
  • Erik Ohlsson
  • David Pendray
  • Tristan de Cacqueray
  • Graham
  • James MacAulay
  • # <h1>NinaLovesToPutLongTextIntoNameFields.GitHubNamesArePrettyFun(IThinkThereAreOnlyAFewAnnoyingBugsAndOneFormShatStoppedWorkingCompletely).AnywayCheckOutGleam!ItIsAReallyCoolLanguageWithALovelyCommunity.BLM!CovidIsNotOver!TransRightsAreHumanRights!</h1>
  • Jachin Rupe
  • The Sentience Company
  • Peter Rice
  • Renato Massaro
  • Yasuo Higano
  • Jonas E. P
  • Fede Esteban
  • Comamoca
  • Patrick Wheeler
  • Abel Jimenez
  • Nikolas
  • n8n - Workflow Automation
  • Christopher De Vries
  • Sakari Bergen
  • Henrik Tudborg
  • R.Kawamura
  • Martin Fojtík
  • Qdentity
  • dagi3d
  • Strandinator
  • Anthony Scotti
  • Jojor
  • Jimpjorps™
  • ginkogruen
  • Arthur Weagel
  • David Cornu
  • Igor Montagner
  • Zsolt Kreisz
  • Julian Hirn
  • Dylan Carlson
  • Robert Ellen
  • Henry Warren
  • Matthew Jackson
  • Giovanni Kock Bonetti
  • Danny Martini
  • blurrcat
  • Bruce Williams
  • Oliver Medhurst
  • Aboio
  • Cameron Presley
  • Sam Zanca
  • Rodrigo Álvarez
  • Scott Zhu Reeves
  • Sgregory42
  • Jonas Hedman Engström
  • METATEXX GmbH
  • Corentin J.
  • Francis Hamel
  • Brian Glusman
  • Ben Myles
  • Coder
  • Clifford Anderson
  • Iain H
  • Jan Pieper
  • Ian M. Jones
  • Chris Lloyd
  • Matt Mullenweg
  • Leonardo Donelli
  • Éber Freitas Dias
  • Barry Moore II
  • Lee Jarvis
  • Jake Wood
  • Sean Cribbs
  • Brad Mehder
  • Pedro Correa
  • Kile Deal
  • Tudor Luca
  • Ryan Moore
  • shxdow
  • Tobias Ammann
  • Ian González
  • Brett Kolodny
  • Aliaksiej Homza
  • Daniil Nevdah
  • MoeDev
  • Mark Rudolph
  • OldhamMade
  • Ben Martin
  • Rotabull
  • Dan Dresselhaus
  • Jon Charter
  • Lennon Day-Reynolds
  • Markus Wesslén
  • erlend-axelsson
  • Rasmus
  • Dan Gieschen Knutson
  • Dave Lucia
  • Oliver Tosky
  • Viv Verner
  • Sebastian Porto
  • Johan Strand
  • bucsi
  • Adrian Mouat
  • Antonio Farinetti
  • Carlo Munguia
  • Lukas Bjarre
  • Billuc
  • Jean-Adrien Ducastaing
  • Walton Hoops
  • Savva
  • NicoVIII
  • Sam Aaron
  • Volker Rabe
  • Ernesto Malave
  • Russell Clarey
  • Matt Savoia
  • Paul Guse
  • Geir Arne Hjelle
  • Nick Papadakis
  • Jake Cleary
  • lidashuang
  • Florian Kraft
  • Kramer Hampton
  • Gabriela Sartori
  • Chris Ohk
  • Jan Fooken
  • Alex Manning
  • Mark Markaryan
  • Richard Viney
  • Antharuu
  • Joshua Steele
  • Alistair Smith
  • Cris Holm
  • Bruno Konrad
  • Isaac McQueen
  • Joey Kilpatrick
  • Joey Trapp
  • Daniele
  • John Strunk
  • Michal Timko
  • Cyphernil
  • Filip Figiel
  • Matt Heise
  • Stefan
  • Adam Daniels
  • Johanna Larsson
  • Joseph Lozano
  • Danny Arnold
  • Kristoffer Grönlund
  • rebecca
  • Mark Holmes
  • Bjarte Aarmo Lund
  • Benjamin Moss
  • Jen Stehlik
  • upsidedowncake
  • Scott Wey
  • Alexander Stensrud
  • Natanael Oliveira
  • Noah
  • Redmar Kerkhoff
  • Thomas Crescenzi
  • Emma
  • simone
  • Tim Brown
  • Sammy Isseyegh
  • Jérôme Schaeffer
  • nunulk
  • Tomasz Kowal
  • Andrew Varner
  • Hannes Nevalainen
  • Adi Iyengar
  • Race
  • Matt Van Horn
  • Mikael Karlsson
  • Michael Mazurczak
  • bgw
  • Baqtiar
  • ollie
  • Mike Roach
  • Guilherme de Maio
  • Evan Johnson
  • Michael G
  • Kirill Morozov
  • Justin Lubin
  • Ripta Pasay
  • Alexandre Del Vecchio
  • Thomas
  • Felix
  • Nomio
  • N. G. Scheurich
  • Diemo Gebhardt
  • Marius Kalvø
  • Chew Choon Keat
  • Brett Cannon
  • albertchae
  • Rupus Reinefjord
  • Guillaume Heu
  • Edon Gashi
  • Wilson Silva
  • Philpax
  • Ruslan Ustitc
  • Christopher Dieringer
  • Nicklas Sindlev Andersen
  • Sławomir Ehlert
  • Saša Jurić
  • Aleksei Gurianov
  • Fabrizio Damicelli
  • Renovator
  • Yamen Sader
  • tommaisey
  • Dan
  • Alembic
  • André Mazoni
  • Rico Leuthold
  • Tristan Sloughter
  • Nick Leslie
  • Leon Qadirie
  • Rintaro Okamura
  • Raúl Chouza
  • jooaf
  • Adam Johnston
  • David Bernheisel
  • Ivar Vong
  • Arya Irani
  • Stephane Rangaya
  • Hubert Małkowski
  • Ismael Abreu
  • Leah Ulmschneider
  • Thomas Coopman
  • Caleb Falcione
  • Shane Poppleton
  • Rohan
  • Alex Kelley
  • Robert Attard
  • Krzysztof Gasienica-Bednarz
  • Giacomo Cavalieri
  • Ajit Krishna
  • Martin Janiczek
  • Chad Selph
  • SR
  • Christian Visintin
  • Rob Durst
  • Sean Roberts
  • inoas
  • Jørgen Andersen
  • Julian Schurhammer
  • Dan Piths
  • Martin Rechsteiner
  • Vassiliy Kuzenkov
  • Curling IO
  • Jerred Shepherd
  • Max McDonnell
  • ErikML
  • Seve Salazar
  • Optizio
  • Jean-Luc Geering
  • Jon Lambert
  • Landon
  • Hari Mohan
  • Mark Dodwell
  • G-J van Rooyen
  • Kuma Taro
  • Pete Jodo
  • Luke Amdor
  • Damir Vandic
  • James Birtles
  • Reilly Tucker Siemens
  • Nigel Baillie
  • Henning Dahlheim
  • Adam Brodzinski
  • Benjamin Kane
  • Xucong Zhan
  • Christopher Keele
  • Jimmy Utterström
  • 音㦡
  • Hans Raaf
  • Eileen Noonan
  • Sigma

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.