The topic of this article may not meet Wikipedia's
general notability guideline. (March 2024) |
Paradigm | Multi-paradigm: functional, concurrent [2] |
---|---|
Designed by | Louis Pilfold |
Developer | Louis Pilfold |
First appeared | June 13, 2016 |
Stable release | 1.1.0
[3]
/ 16 April 2024 |
Typing discipline | Type-safe, static, inferred [2] |
Memory management | Garbage collected |
Implementation language | Rust |
OS | FreeBSD, Linux, macOS, OpenBSD, Windows [4] |
License | Apache License 2.0 [5] |
Filename extensions | .gleam |
Website |
gleam |
Influenced by | |
[6] |
Gleam is a general-purpose, concurrent, functional high-level programming language that compiles to Erlang or JavaScript source code. [2] [7]
Gleam is a statically-typed language, [8] which is different from the most popular languages that run on Erlang’s virtual machine BEAM, Erlang and Elixir.
import gleam/io
pub fn main() {
io.println("hello, friend!")
}
Gleam supports tail call optimization: [9]
pub fn factorial(x: Int) -> Int {
// The public function calls the private tail recursive function
factorial_loop(x, 1)
}
fn factorial_loop(x: Int, accumulator: Int) -> Int {
case x {
1 -> accumulator
// The last thing this function does is call itself
_ -> factorial_loop(x - 1, accumulator * x)
}
}
The topic of this article may not meet Wikipedia's
general notability guideline. (March 2024) |
Paradigm | Multi-paradigm: functional, concurrent [2] |
---|---|
Designed by | Louis Pilfold |
Developer | Louis Pilfold |
First appeared | June 13, 2016 |
Stable release | 1.1.0
[3]
/ 16 April 2024 |
Typing discipline | Type-safe, static, inferred [2] |
Memory management | Garbage collected |
Implementation language | Rust |
OS | FreeBSD, Linux, macOS, OpenBSD, Windows [4] |
License | Apache License 2.0 [5] |
Filename extensions | .gleam |
Website |
gleam |
Influenced by | |
[6] |
Gleam is a general-purpose, concurrent, functional high-level programming language that compiles to Erlang or JavaScript source code. [2] [7]
Gleam is a statically-typed language, [8] which is different from the most popular languages that run on Erlang’s virtual machine BEAM, Erlang and Elixir.
import gleam/io
pub fn main() {
io.println("hello, friend!")
}
Gleam supports tail call optimization: [9]
pub fn factorial(x: Int) -> Int {
// The public function calls the private tail recursive function
factorial_loop(x, 1)
}
fn factorial_loop(x: Int, accumulator: Int) -> Int {
case x {
1 -> accumulator
// The last thing this function does is call itself
_ -> factorial_loop(x - 1, accumulator * x)
}
}