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.
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.
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.
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.
import gleam/io
pub fn main() {
io.println("Hello, world!")
}
import gleam/bit_builder
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)
}
import gleam/io
import gleam/int
import gleam/list
import gleam/string
import gleam/otp/process
pub fn main() {
list.range(0, 1000)
|> list.each(start_process)
}
fn start_process(i) {
process.start(fn() {
let message = string.append("Hello world: ", int.to_string(i))
io.println(message)
})
}