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)

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

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.