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)

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

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.