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)

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

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.