Gleam (1.19)

This assessment applies the coupling account — coupling as access to a shared resource, and the coupling floor [1], [2] — and the knowledge-embodiment theorem [3]; the language is assessed against its official reference [4].

Snapshot Gleam (1.19) — released 5 October 2026 · lifecycle current

Family Gleam — shelf: Application

The language’s main business is building general application software, with a managed runtime or a rich standard library. A shelf groups; it does not classify — the tags below carry every use, paradigm, and platform of this snapshot.

Trajectory 0.1 (15 April 2019 — first public release) · 1.19 (5 October 2026 — assessed release)

Tags

Use — Application, Web back end

Paradigm — Functional, Concurrent

Platform — BEAM

Lifecycle — Current

Memory — Managed (GC)

Typing — Static, strong

Resources

The language’s official entry points, and the documents that name the release this page assesses. A link marked this release pins the document to Gleam (1.19); an unmarked link is the current reference for the language.

Landing page

Specification and reference

API documentation

Tutorial

1 Assessment

This page assesses Gleam in five parts: core coupling — what the language’s own constructs force; ecosystem coupling — what the surrounding platform, tooling, and community cost; engineering readiness — whether the artifact can be reproduced, verified, observed, worked in quickly, connected to other languages, and governed openly; the profile — the unscored facts a score cannot express; and the scoring detail — the mechanism marks and the arithmetic behind every score. A ✅ bullet marks a construct that helps. A ⚠️ or ❌ bullet marks a cost; the scoring model does not price every cost named here.

Core coupling 90.9/100 · Ecosystem coupling 93.8/100 · Engineering readiness 61.4/100

1.1 Core coupling

1.1.1 Type

  • ✅ Static types with full inference: A function’s types are checked at compile time, and an annotation is optional almost everywhere
  • ✅ A custom type is the only way to add a case: A case over a custom type is checked for exhaustiveness, so a new variant breaks every site that must handle it
  • ✅ There is no null: Absence is Option(a), and the compiler rejects a use of the option as a plain value
  • ✅ There is no inheritance and no class: Data is a custom type and behaviour is a function, so there is no hierarchy to couple to
  • ✅ An opaque type hides its representation: A module can export a type without its constructor, so the invariant is enforced at the module boundary
  • ✅ Generics are parametric and checked: Result(a, e), List(a), and a user type take type parameters with no cast
  • ⚠️ There are no type classes or traits: Reuse across types goes through a record of functions passed to a generic function, not through a shared interface
  • ❌ A call’s effects are not in its type: A signature says what a function returns, not that it reads a process dictionary, sends a message, or panics (T12)
  • ❌ The foreign boundary is a promise: An external function names its Erlang or JavaScript counterpart by hand, and nothing checks that the two agree (T14)

1.1.2 Construction

  • ✅ A constructor is the only way to make a value: A custom type’s constructor checks every field, and a case cannot build one that the type does not declare
  • ✅ A record updates by copy: Person(..person, name: "Ada") returns a new value and leaves the original alone
  • ✅ A module holds functions, not mutable state: There is no global variable to read or write during construction
  • ⚠️ Construction is explicit: There are no default values and no implicit conversions, so every field is passed at the call site

1.1.3 Memory

  • ❌ The BEAM collects each process separately: A process has its own heap, and the pause is the runtime’s to schedule (M2)
  • ✅ Data is immutable: A value is never changed in place, so two holders cannot disagree about its contents
  • ✅ A process owns its heap: A value is copied between processes, so no reference is shared across a process boundary
  • ✅ There is no manual deallocation: The runtime frees memory, so a double free or a use after free cannot occur
  • ⚠️ No destructor runs at scope exit: A resource follows the process lifetime or an explicit close, not a block boundary
  • ❌ The undeclared class has no catch: Gleam rides the BEAM atom table (documented), and node failure outranks every rescue (Er6)

1.1.4 Error

  • ✅ A failure is a value: A fallible function returns Result(a, e), and the type says so
  • ✅ use threads the failure path: use x <- result.try(f()) returns a failure to the caller without a match at each step
  • ✅ A panic is a process crash: panic ends the process and is not a channel for a recoverable failure
  • ⚠️ The error type is the module’s choice: Nothing in the language forces one error type across modules

1.1.5 Concurrency

  • ✅ A process is the unit of concurrency: A Gleam process is an Erlang process with its own heap and mailbox
  • ✅ A message replaces shared memory: Two processes exchange a value by copy, so a data race between them cannot occur
  • ✅ OTP supervises the tree: A supervisor restarts a failed child, so failure handling is a supervision tree rather than a try block
  • ✅ There is no second function kind: A function does not become async; the runtime schedules processes, so no colour spreads through the call graph
  • ⚠️ The actor library is a package: gleam_otp supplies the actor and supervisor abstractions, so their version is a dependency

1.1.6 Platform

  • ✅ One source compiles to two runtimes: gleam build --target erlang emits for the BEAM and --target javascript emits for Node and the browser
  • ✅ The Erlang back end emits abstract forms: The compiler produces Erlang’s intermediate representation and skips the Erlang front end, so a crash report names a Gleam line
  • ✅ Interop on the BEAM is zero-cost: A Gleam module and an Erlang or Elixir module call each other without a marshalling layer
  • ⚠️ The two targets have different runtimes: A program that runs on both meets the BEAM scheduler on one target and the JavaScript event loop on the other

1.1.7 Trade-offs (not coupling)

  • A small ecosystem is the price of a young language: Fewer packages mean more code written locally; this is a community outcome, not a language mechanism
  • Two targets, two runtimes: A program that runs on the BEAM and in JavaScript meets two schedulers and two sets of libraries
  • No OOP is a deliberate subtraction: Reuse goes through functions and records, so a team accustomed to inheritance rewrites its habits
  • The foreign boundary is untyped: An external function is a hand-written promise on both the Erlang and the JavaScript side
  • Immutability copies at the process boundary: A message is copied between processes, which is safe and not free
  • The cadence is fast and the language is young: A short release cycle is a fix rate and a moving target

1.2 Ecosystem coupling

1.2.1 Performance

  • ✅ The compiler is fast: A full build of the published benchmark project completes in a fraction of a second, and a rebuild is incremental
  • ❌ A collection pause is part of the timing: The BEAM collects a process independently, and the pause is a latency budget’s cost (R2)
  • ✅ The BEAM compiles the hot path: The runtime’s JIT compiles a hot function, so a long-running service does not run interpreted
  • ⚠️ The JavaScript target inherits the engine’s limits: Speed on that target is the JavaScript engine’s, not the language’s

1.2.2 Ecosystem

  • ✅ gleam add and Hex are the whole dependency story: A manifest, a lockfile, and a central registry are part of the toolchain
  • ✅ One binary holds the toolchain: build, format, test, add, and the language server ship together
  • ❌ The ecosystem is small: The package pool is younger and thinner than the mainstream registries, so more code is written than found (Ec3)
  • ✅ The BEAM ecosystem is reachable: A project can depend on Erlang and Elixir packages and call them directly
  • ⚠️ The language is young: A library can change quickly, and a tutorial can lag a release
  • ✅ The NIF ABI is versioned and checked at load on the BEAM runtime it runs on [5] (Ec8)

1.2.3 Evolution

  • ✅ Releases follow semantic versioning: A 1.x release keeps the language compatible, and a package states the version it requires
  • ✅ The cadence is short: A release arrives every six to eight weeks, so a fix is not held for a year
  • ✅ Mechanical migrations ship with the compiler: A deprecation arrives with a fix in the compiler or the formatter
  • ⚠️ A pre-1.0 package can break: A dependency that has not reached 1.0 may change in a breaking release

1.2.4 Domain

  • ✅ A web service is the ordinary project: Wisp and the OTP libraries make an HTTP service the default shape
  • ✅ The browser is a supported target: Lustre compiles a Gleam program to the front end through the JavaScript target
  • ✅ A command-line tool is supported: An escript packages a single-file program for the BEAM
  • ⚠️ The centre is server-side: Examples, packages, and hiring lean toward backend work on the BEAM

1.2.5 Learning

  • ✅ The language is small: The official tour covers the whole language in an afternoon
  • ✅ An error carries the fix: The compiler names the mismatch and often prints the corrected code
  • ✅ The language server is the compiler: Completion, rename, and go-to-definition come from the same binary
  • ⚠️ Inference hides a type at the boundary: A reader sometimes has to ask the editor for an inferred type

1.2.6 Syntax

  • ✅ Every construct is an expression: A case, a let, and a function body produce a value, so a value is defined where it is computed
  • ✅ The pipeline reads left to right: value |> f |> g states the data flow without an intermediate name
  • ✅ A label names the argument at the call site: request.new(method: Get, path: "/") reads without the definition
  • ⚠️ The braces and commas are load-bearing: The syntax is small but strict, and a missing comma is a compile error

1.2.7 Testing

  • ✅ gleam test runs the suite: The toolchain discovers and runs the test modules
  • ✅ gleeunit is the standard harness: A test is a function, and a failed assertion stops the module
  • ✅ The compiler checks the test: A test is type-checked with the project, so a broken test does not compile
  • ⚠️ The harness is a package: gleeunit is a dependency, and its version must match the compiler’s expectations

1.2.8 Security

  • ✅ Memory safety belongs to the runtime: A program cannot read or write outside its data, and the language has no unsafe
  • ✅ Immutability removes a class of bugs: A value cannot change under a holder
  • ✅ There is no eval: The language has no construct that turns a string into code
  • ⚠️ The foreign boundary is unchecked: An external function’s signature is a promise, and the other runtime does not verify it

1.2.9 Delivery targets

What ships from a producer to a consumer, and whether the interface across a release boundary is promised. Ec8 is present when one compiled target crosses with no promise.

Target Ships as Crosses a producer boundary Cross-release promise
hex package source source no A hex package ships source compiled to BEAM bytecode
NIF library compiled yes yes — The NIF API version compiles into the library, and the runtime checks it at load [5]

1.3 Engineering readiness

1.3.1 Reproducibility

  • ❌ The build does not check reproducibility: gleam build writes BEAM or JavaScript output and never compares a rebuild against a published artifact, so a consumer cannot confirm the two match (Y1)

1.3.2 Supply chain

  • ❌ A package carries no build attestation: The registry signs its own index, but nothing in a release states who built it or from what source, so a compromised build is not distinguishable from a genuine one (Y3)
  • ❌ Hex names are global: A package name is unique across the registry, so an owner is not separated by a namespace (Y4)

1.3.3 Observability

  • ❌ No tracing standard is part of the language: A project chooses an OpenTelemetry package and its own conventions, and the standard library states none (Y5)

1.3.4 Feedback

  • ✅ The compiler is the language server: An error is reported in the editor as the file is saved, and a rebuild is incremental

1.3.5 Interop

  • ✅ Interop is a language feature: A module calls Erlang, Elixir, or JavaScript through a declared external function, so the boundary is written down

1.3.6 Governance

  • ❌ Semantics rest on the compiler riding the BEAM: the documentation describes the implementation’s behavior, and no conformance suite exists (Y17)

1.4 Profile

Unscored, and kept separate from every score on purpose. The profile records what a mechanism price cannot express: what a running program costs, how well a coding model and an agent work in the language, and whether a safety-critical path exists.

1.4.1 Energy and cost

What this axis asks: what does a running program cost in energy and time?

  • ⚠️ Runs on the BEAM, above native code in the energy and time benchmarks [6]; a causal re-analysis attributes most of the gap to execution time [7].

1.4.2 AI and agent readiness

What this axis asks: how well does a coding model and an agent work in this language?

  • ❌ Sparse training data: models write it less reliably than a mainstream language [8].

1.4.3 Safety certification

What this axis asks: is there a certified or standards-qualified path to a safety-critical system?

  • ⚠️ No certified or standards-qualified path for safety-critical systems.

1.5 Scoring detail

1.5.1 Core coupling Dimensions

Dimension Mechanism Description Imposed by Present Weight
Type T1 dynamic no static check language — 0
T2 weak static language — 0
T3 dynamic/duck dispatch language — 0
T4 no sum types language — 0
T5 no generics language — 0
T6 no namespaces language — 0
T7 type erasure/reflection language — 0
T8 operator overloading language — 0
T9 inheritance required for polymorphism language — 0
T10 no null-safety language — 0
T11 no module boundary language — 0
T12 no effect tracking language ✅ −8
T13 async/sync colouring language — 0
T14 unchecked foreign boundary language ✅ −4
T15 chars are encoding units language — 0
Type cost −3.4 (−12)
Construction C1 global mutable state by default language — 0
C2 no immutability by default language — 0
C3 constructors coupled to allocation language — 0
C4 no constructor/validation language — 0
C5 unpinned collection order language — 0
C6 aliasing by default language — 0
C7 undeclared control transfer language — 0
C8 no source-visible init order language — 0
Construction cost 0
Memory M1 manual deallocation runtime — 0
M2 GC non-deterministic pauses runtime ✅ −8
M3 no RAII language — 0
M4 no ownership model language — 0
M5 uninitialized reads language — 0
M6 unchecked reinterpretation language — 0
Er6 uncatchable runtime fault language ✅ −8
M7 reference cycles leak runtime — 0
Memory cost −4.6 (−16)
Error Er1 no structured path language — 0
Er2 unchecked exceptions only language — 0
Er3 errors ignored/non-exhaustive language — 0
Er4 no composable result type language — 0
Er5 no isolation unit for a fault runtime — 0
Error cost 0
Concurrency K1 GIL/no parallel runtime — 0
K2 shared mutable state default language — 0
K3 manual sync no race detection runtime — 0
K4 no structured concurrency language ✅ −4
K5 no primitives language — 0
K6 thread-per-task cost runtime — 0
Concurrency cost −1.1 (−4)
Platform P1 cannot function outside one vendor/domain context — 0
P2 single-vendor but other uses context — 0
P3 legacy/discontinued platform context — 0
P4 poor domain fit context — 0
Platform cost 0

Core coupling score: 90.9/100 — 32 of the 350 inventory points are present, so the axis cost is 100 × 32 ÷ 350 = 9.1 and the score is 100 − 9.1. Each dimension’s cost above is its share of the same denominator, and the raw weight sum follows in parentheses.

1.5.2 Ecosystem coupling Dimensions

Dimension Mechanism Description Imposed by Present Weight
Performance R1 interpreted no AOT/JIT runtime — 0
R2 GC pauses runtime ✅ −8
R3 JIT warmup runtime — 0
Performance cost −3.1 (−8)
Ecosystem Ec1 no package manager context — 0
Ec2 fragmented tooling context — 0
Ec3 small/niche/discontinued context ✅ −8
Ec4 proprietary context — 0
Ec5 platform-locked tooling context — 0
Ec6 monoculture context — 0
Ec7 legacy burden context — 0
Ec8 unpromised binary boundary context — 0
Ec9 unpromised data boundary context — 0
Ecosystem cost −3.1 (−8)
Evolution V1 breaking changes language — 0
V2 frozen context — 0
V3 discontinued context — 0
V4 glacial standards context — 0
V5 silent default drift runtime — 0
V7 build-variant state space context — 0
Evolution cost 0
Domain D1 domain/vendor lock-in context — 0
D3 framework forces architecture context — 0
Domain cost 0
Learning L1 steep context — 0
L2 large surface/multi-paradigm context — 0
L3 sparse docs context — 0
Learning cost 0
Syntax S1 verbose language — 0
S2 inconsistent language — 0
S3 punctuation-heavy language — 0
Syntax cost 0
Testing G1 weak tooling context — 0
G2 poor debugging context — 0
G3 runtime-only errors context — 0
G4 no published monotonic clock runtime — 0
Testing cost 0
Security Q1 memory-unsafe language — 0
Q2 dynamic/weak typing risk language — 0
Q3 known vulnerability/injection context — 0
Q4 silent integer overflow language — 0
Security cost 0

Ecosystem coupling score: 93.8/100 — 16 of the 256 inventory points are present, so the axis cost is 100 × 16 ÷ 256 = 6.2 and the score is 100 − 6.2. Each dimension’s cost above is its share of the same denominator, and the raw weight sum follows in parentheses.

1.5.3 Engineering readiness Dimensions

Dimension Mechanism Description Imposed by Present Weight
Reproducibility Y1 build not reproducible context ✅ −15
Y2 dependencies not pinned context — 0
Y14 no toolchain version pin context ✅ −8
Y18 no machine-read project contract context — 0
Reproducibility cost −13.5 (−23)
Supply chain Y3 no signed provenance context ✅ −15
Y4 registry without namespacing context ✅ −4
Y16 no advisory feed context — 0
Supply chain cost −11.1 (−19)
Observability Y5 no stable tracing standard context ✅ −8
Y6 no structured logging context — 0
Y15 no post-mortem diagnostics runtime — 0
Observability cost −4.7 (−8)
Feedback Y7 slow build context — 0
Y8 no fast in-editor analysis context — 0
Y13 no bundled debugger context ✅ −8
Feedback cost −4.7 (−8)
Interop Y9 no foreign-function interface language — 0
Y10 no portable target context — 0
Interop cost 0
Governance Y11 single-vendor governance context — 0
Y12 closed specification context — 0
Y17 no conformance mechanism context ✅ −8
Y19 no published parser context — 0
Governance cost −4.7 (−8)

Engineering readiness score: 61.4/100 — 66 of the 171 inventory points are present, so the axis cost is 100 × 66 ÷ 171 = 38.6 and the score is 100 − 38.6. Each dimension’s cost above is its share of the same denominator, and the raw weight sum follows in parentheses.

Verdict: Gleam’s design yields low language-imposed coupling. Static inference removes the dynamic-typing mechanisms, custom types and exhaustive matching remove the missing-sum-type mechanism, and Option and Result put absence and failure in the type. The BEAM gives it process isolation, so no shared-memory race is expressible, and it avoids function colouring because a process, not an async function, is the unit of concurrency. Main strength: a small language whose defaults — immutability, exhaustive matching, errors as values — leave few coupling mechanisms to price. Main weakness: the ecosystem is young and thin, the foreign boundary is unchecked, and the runtime’s collector still schedules the heap.


The formal development. The definitions, theorems, and proofs behind this page are published in:

All published papers

References

[1]
Y. Loth, “On the nature of coupling: All coupling as shared resource access.” Zenodo, Aug. 2026. doi: 10.5281/zenodo.21925121.
[2]
Y. Loth, “Coupling as a consequence of cohesion: Decomposition, the coupling floor, and domain-imposed coupling.” Zenodo, Aug. 2026. doi: 10.5281/zenodo.21925201.
[3]
Y. Loth, “On the nature of cohesion: Cohesion as correctness relative to a partitioning rule.” Zenodo, Jul. 2026. doi: 10.5281/zenodo.20492912.
[4]
L. Pilfold and T. G. Contributors, “Gleam language documentation.” The Gleam Project, 2026. Available: https://gleam.run/documentation/
[5]
Erlang/OTP project, “Erl_nif — version management and compatibility checks at load.” Ericsson, 2026. Available: https://www.erlang.org/doc/man/erl_nif.html
[6]
R. Pereira et al., “Energy efficiency across programming languages: How do energy, time, and memory relate?” in Proceedings of the 10th ACM SIGPLAN international conference on software language engineering (SLE), 2017, pp. 256–267. doi: 10.1145/3136014.3136031.
[7]
N. van Kempen, H.-J. Kwon, D. T. Nguyen, and E. D. Berger, “It’s not easy being green: On the energy efficiency of programming languages,” in Proceedings of the 40th IEEE/ACM international conference on automated software engineering (ASE), 2025. doi: 10.1109/ASE63991.2025.00131.
[8]
S. Joel, J. J. Wu, and F. H. Fard, “A survey on LLM-based code generation for low-resource and domain-specific programming languages,” ACM Transactions on Software Engineering and Methodology, 2025, doi: 10.1145/3770084.