Try Gleam
First reported by Nchagnet.eu ·
You can now write code that runs reliably on both server-side BEAM and in the browser via JavaScript.
Gleam, a functional programming language, is gaining traction for its ability to target both the Erlang VM (BEAM) and JavaScript. The language emphasizes a simple syntax, static typing, and strong interoperability with the existing BEAM ecosystem, making it attractive to developers familiar with languages like Rust. Gleam's features include immutable variables, a pipe operator (|>) for function chaining, a `use` pattern to manage callbacks and avoid indentation creep, and tail-call optimization to handle recursion efficiently without stack overflows. Its static typing, similar to Rust's approach with enums and structs using algebraic data types, ensures type safety and allows for code sharing across its different compilation targets. The language leverages the BEAM's strengths in concurrency and fault tolerance, enabling the creation of scalable systems through its process management capabilities.
Gleam's dual compilation targets (BEAM and JavaScript) are significant, allowing developers to share type definitions and logic across front-end and back-end applications. This interoperability is particularly valuable for web development where consistency between client and server code is crucial. The language's design, drawing inspiration from Rust's type safety and functional programming paradigms, offers a familiar yet distinct experience for developers migrating from other systems.
The adoption of Gleam signals a growing interest in languages that bridge the gap between high-level abstractions and performant, scalable runtime environments like BEAM. Its focus on developer experience, through features like the `use` pattern and pipe operator, aims to reduce common pain points in functional programming. As Gleam matures, its ability to compile to both BEAM and JavaScript could lead to more unified development workflows and cross-platform application architectures.
AI-written summary. May contain errors.