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 spawn_many() -> List(Pid) {
  // Run loads of green threads, no problem
  list.range(0, 200_000)
  |> list.map(spawn_greeter)
}

fn spawn_greeter(i: Int) -> Pid {
  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)

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

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.