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)

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

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.