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)

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

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.