Gleam (programming language)
Gleam is a general-purpose, concurrent, functional, high-level programming language that compiles to Erlang or JavaScript source code. Gleam is a statically-typed language, which is different from the most popular languages that run on Erlang’s virtual machine BEAM, Erlang and Elixir. Gleam has its own type-safe implementation of OTP, Erlang's actor framework. Packages are provided using the Hex package manager, and an index for finding packages written for Gleam is available. Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.
Gleam is a general-purpose, concurrent, functional, high-level programming language that compiles to Erlang or JavaScript source code. Gleam is a statically-typed language, which is different from the most popular languages that run on Erlang’s virtual machine BEAM, Erlang and Elixir. Gleam has its own type-safe implementation of OTP, Erlang's actor framework. Packages are provided using the Hex package manager, and an index for finding packages written for Gleam is available. import gleam/io pub fn main() { io.println("hello, world!") } Gleam supports tail call optimization: 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) } }
Cite this
"Gleam (programming language)". 1769464925. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1335022728 JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy