TL;DR

Gleam is a statically typed, functional language that targets the Erlang virtual machine (BEAM) and can also compile to JavaScript. The project emphasizes strong tooling, safe defaults (no nulls or exceptions), and interoperability with Erlang and Elixir packages.

What happened

Gleam presents itself as a modern functional language built for the BEAM ecosystem, aiming to combine a practical type system and concise syntax with the concurrency and fault-tolerance of the Erlang runtime. The site highlights built-in tooling — including a compiler, build tool, formatter, editor integrations and a package manager — and shows examples of installing a package and running tests. It promotes the BEAM’s ability to run large numbers of lightweight processes and a concurrent garbage collector that avoids stop-the-world pauses, illustrating this with sample code that spawns hundreds of thousands of green threads. The language also supports interop with Erlang and Elixir libraries, can compile to JavaScript, and emits TypeScript definitions. Error messages are shown as actionable and user-friendly. The project emphasizes a welcoming community, an explicit code of conduct, and options for sponsorship and a newsletter.

Why it matters

  • Runs on the BEAM, which is used in high-scale systems and emphasizes concurrency and fault tolerance.
  • Combines static typing and functional programming to reduce runtime errors and improve maintainability.
  • Built-in tooling and package management aim to lower friction for creating and testing projects.
  • Interoperability with Erlang/Elixir and JavaScript outputs broadens library and deployment options.

Key facts

  • Gleam targets the Erlang virtual machine (BEAM) and can also compile to JavaScript.
  • The language advertises no null values and no exceptions, paired with a practical type system.
  • Examples on the site show spawning large numbers of lightweight processes (e.g., range of 0 to 200,000).
  • Gleam ships with integrated tooling: compiler, build tool, formatter, editor integrations, and a package manager.
  • Gleam programs can use packages written in Gleam, Erlang, or Elixir and the site demonstrates adding 'gleam_json' (v0.5.0).
  • A test run example shows compilation and a test suite completing in 1.67s with 1 test and 0 failures.
  • The site shows an illustrative compile-time error message that suggests corrections for unknown record fields.
  • The project emphasizes a community code of conduct and explicitly states inclusive values on its site.

What to watch next

  • Broader production adoption and which organizations choose Gleam for BEAM workloads — not confirmed in the source
  • Growth and diversity of the package ecosystem beyond existing BEAM libraries — not confirmed in the source
  • Real-world use of the JavaScript compilation output and generated TypeScript definitions in front-end projects — not confirmed in the source

Quick glossary

  • BEAM: The virtual machine that runs Erlang, Elixir, and other languages; designed for concurrency, distribution, and fault tolerance.
  • Static type system: A system where types are checked at compile time to catch certain classes of errors before the program runs.
  • Functional programming: A programming paradigm that emphasizes immutable data and functions as first-class values.
  • Garbage collector: Runtime component that reclaims memory no longer in use; concurrent garbage collectors run alongside application threads to reduce pause times.

Reader FAQ

What is Gleam?
A statically typed functional language designed to run on the BEAM and able to compile to JavaScript.

Does Gleam interoperate with existing BEAM libraries?
Yes. The site states Gleam can use packages written in Gleam, Erlang, or Elixir.

How does Gleam handle runtime errors like nulls or exceptions?
The site says Gleam has no null values and no exceptions, and offers clear compiler error messages.

Is tooling included?
Yes. Gleam includes a compiler, build tool, formatter, editor integrations, and a package manager.

The power of a type system, the expressiveness of functional programming, and the reliability of the highly concurrent, fault tolerant Erlang runtime, with a familiar and modern syntax. import gleam/io…

Sources

Related posts

By

Leave a Reply

Your email address will not be published. Required fields are marked *