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 a 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)

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

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.