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)

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

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

Powered by EmailOctopus

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.