Back to articles
Gleam Has a Free API: Type-Safe Erlang/JS That's Actually Fun to Write

Gleam Has a Free API: Type-Safe Erlang/JS That's Actually Fun to Write

via Dev.to WebdevAlex Spinov

Gleam is a type-safe functional language that compiles to Erlang (BEAM) and JavaScript. It gives you Erlang's legendary fault tolerance with modern developer experience — great error messages, no null, no exceptions. Why Gleam? Type-safe — catches errors at compile time, not production Dual target — compile to Erlang (backend) or JavaScript (frontend) BEAM ecosystem — use any Erlang/Elixir library No null, no exceptions — Result types instead Great DX — fast compiler, helpful errors, LSP Install # macOS brew install gleam # Linux curl -sSfL https://gleam.run/install | sh # Or via asdf asdf plugin add gleam asdf install gleam latest Quick Start gleam new my_app cd my_app gleam run Basic Gleam // src/my_app.gleam import gleam/io import gleam/string import gleam/list import gleam/int pub fn main() { // Variables are immutable let name = "World" io.println("Hello, " <> name <> "!") // Pattern matching let result = divide(10, 3) case result { Ok(value) -> io.println("Result: " <> int.to_str

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
2 views

Related Articles