August 5th, 2024

First impressions of Gleam: lots of joys and some rough edges

Gleam is a functional programming language for BEAM and JavaScript, offering strong documentation, a supportive community, and effective pattern matching, but lacks traditional loops and can produce confusing type alias errors.

Read original articleLink Icon
First impressions of Gleam: lots of joys and some rough edges

Gleam is a functional programming language designed to run on both the BEAM (Erlang's VM) and JavaScript, making it suitable for both frontend and backend development. The author, encouraged by a friend, explores Gleam and appreciates its features, such as excellent documentation, a welcoming community, and effective pattern matching. The language allows for exhaustiveness checking and structural pattern matching, which enhances code clarity. Gleam's immutability is complemented by shadowing, providing a safe way to modify variables without introducing race conditions. The language also supports qualified imports, improving code discoverability, and uses labeled arguments to clarify intent. However, the author notes some drawbacks, including the absence of traditional loops, which can complicate readability and performance in certain scenarios. Additionally, type aliases can lead to confusing error messages. Overall, while Gleam has many appealing features, it also presents challenges that may affect its adoption in real-world applications.

- Gleam targets both BEAM and JavaScript, facilitating frontend and backend development.

- The language features strong documentation, a supportive community, and effective pattern matching.

- Immutability is managed through shadowing, enhancing safety in variable management.

- The absence of traditional loops can complicate code readability and performance.

- Type aliases may result in confusing error messages during development.

Link Icon 2 comments
By @fredrikholm - 6 months
What a wonderful write up. Great read!

Gleam is such a blessing for the BEAM; it's the VM I know best and prefer working in, but for the best of me I find it very difficult to develop software without a (fully realized) type system.

I hope it continues to grow at the pace it has been doing lately.