Gleam

Statically-typed functional programming language that runs on the Erlang BEAM VM and compiles to JavaScript. Gleam brings Elm-inspired type safety to the BEAM ecosystem — no runtime errors from type mismatches, exhaustive pattern matching, and friendly compiler error messages. Unlike Elixir (dynamic), Gleam is fully type-inferred with compile-time guarantees. Runs alongside Elixir and Erlang code, shares BEAM's concurrency and fault tolerance. Gleam 1.0 released in 2024.

Evaluated Mar 06, 2026 (0d ago) v1.x
Homepage ↗ Repo ↗ Developer Tools gleam functional-programming erlang beam type-safe elixir-interop javascript concurrency
⚙ Agent Friendliness
66
/ 100
Can an agent use this?
🔒 Security
89
/ 100
Is it safe for agents?
⚡ Reliability
81
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
82
Error Messages
90
Auth Simplicity
95
Rate Limits
92

🔒 Security

TLS Enforcement
100
Auth Strength
88
Scope Granularity
82
Dep. Hygiene
85
Secret Handling
88

Static type system prevents entire classes of runtime errors. BEAM fault tolerance. No reflection or unsafe casts. Immutable data structures prevent race conditions.

⚡ Reliability

Uptime/SLA
80
Version Stability
78
Breaking Changes
75
Error Recovery
90
AF Security Reliability

Best When

You want Erlang BEAM's concurrency and fault tolerance with ML-style type safety, or you're writing a new BEAM service and want compile-time guarantees over Elixir's dynamic approach.

Avoid When

You need the rich Elixir/Erlang ecosystem — Gleam's package ecosystem is young. Elixir with Dialyzer covers most type safety needs with a vastly larger library ecosystem.

Use Cases

  • Build type-safe BEAM services for agent backends where Gleam's compile-time type checking prevents runtime errors in production
  • Share BEAM VM infrastructure (supervisors, processes, distributed Erlang) with existing Elixir apps while writing new agent code in Gleam for type safety
  • Compile agent frontend code to JavaScript using Gleam's JS target — same type-safe language for both BEAM backend and browser frontend
  • Write Gleam libraries that interop with Elixir — Gleam modules callable from Elixir and vice versa, enabling gradual adoption in Elixir codebases
  • Build event-driven agent services with BEAM OTP patterns (GenServer equivalent via gleam_otp) with Gleam's type safety

Not For

  • Teams not using BEAM ecosystem — Gleam runs on BEAM; use Elm, F#, or Haskell for typed functional programming without BEAM
  • Large ecosystem requirement — Gleam's package ecosystem is small compared to Elixir or mainstream languages; many libraries require FFI wrappers
  • Teams expecting Ruby/Python ergonomics — Gleam is functional and statically typed; metaprogramming (Elixir macros) is not available

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
No
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

Programming language — no auth concepts. Gleam HTTP libraries (wisp, glen) implement auth as middleware.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

Gleam is Apache 2.0 licensed, created by Louis Pilfold. Free for all use. hex.pm hosts Gleam packages.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • Small standard library — Gleam's stdlib is intentionally minimal; many common tasks (regex, date handling, advanced HTTP) require third-party packages from hex.pm which may be immature
  • Gleam uses Result type, no exceptions — all errors must be handled via case result { Ok(v) -> ... Error(e) -> ... }; forgetting error branches is a compile error
  • JavaScript target differences — Gleam code compiled to JS doesn't have BEAM OTP features (supervisors, processes); JS target is for browser/Node.js, BEAM target for server
  • Erlang interop requires extern blocks — calling Erlang/Elixir from Gleam requires @external annotations; type safety at FFI boundary is developer responsibility
  • No macros or metaprogramming — Gleam is intentionally meta-programming free; complex DSLs or code generation that Elixir handles with macros require build-time codegen tools
  • Package ecosystem is small — hex.pm has Gleam packages but far fewer than Elixir; many agent use cases require writing Gleam wrappers around Erlang/Elixir libraries

Alternatives

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for Gleam.

$99

Scores are editorial opinions as of 2026-03-06.

5215
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered