Why Gleam?

Safe

Gleam's powerful static type system helps find and prevent bugs at compile time, long before it reaches your users. It also serves as a productive refactoring tool, enabling programmers to confidently make large changes to unfamiliar code, quickly and with low risk.

For problems the type system can't solve (such as your server being hit by a bolt of lightning) the Erlang virtual machine provides well tested mechanisms for gracefully handling failure.

Friendly

Hunting down bugs can be stressful so Gleam's compiler provides clear and helpful feedback about any problems. We want to spend more time developing features and less time looking for bugs or deciphering cryptic error messages.

As a community we want to be friendly too. People of all backgrounds, genders, and experience levels are welcome and must receive equal respect. See our community code of conduct for more.

Performant

Gleam builds on top of the Erlang virtual machine, a best-in-class runtime that has enabled companies such as WhatsApp, Ericsson, Heroku, and Klarna to provide low-latency services at a global scale. Gleam takes full advantage of the Erlang runtime and adds no overhead of its own, so all Gleam programs are as blazingly fast as their Erlang counterpart.

Erlang compatible

Gleam makes it easy to use code written in other BEAM languages such as Erlang, Elixir and LFE, so there's a rich ecosystem of thousands of open source libraries for Gleam users to make use of.

In return Gleam code can be easily used by programmers of other BEAM languages, either by transparently making use of libraries written in Gleam, or by adding Gleam modules to their existing project with minimal fuss.

Examples

Hello, world! The classic example program that prints "Hello, world!" to the console. import gleam / io pub fn main () { io .println ( "Hello, world!" ) }

A basic web server This little web server responds with the text "Hello, world!" to any HTTP request made to it. import gleam / http / elli import gleam / http pub fn my_service ( _ req ) { let body = bit_builder .from_string ( "Hello, world!" ) http .response ( 200 ) | > http .set_resp_body ( body ) } pub fn start () { elli .start ( my_service , on_port : 3000 ) } The web server created by this code is fully asynchronous and multi-threaded, seamlessly making use of all the cores of your computer without tricky locks, callbacks, or promises.