Skip to main content
Back to Beauty Index

Gleam vs Lua

Handsome 47/60
vs
Practical 38/60
Overlay radar chart comparing Gleam and Lua across 6 dimensions Φ Ω Λ Ψ Γ Σ
Gleam
Lua
Download comparison image

Gleam

The new kid who showed up and immediately made the honor roll. Still young — hit 1.0 in 2024 — but already the number-two most admired language. No null, no exceptions, no implicit behavior. Radical simplicity as philosophy.

Lua

The compact Swiss army knife that fits in any pocket. Lua is so small and embeddable that it powers everything from World of Warcraft to nginx configs without anyone noticing.

Gleam scores 47/60 against Lua's 38/60, leading in 6 of 6 dimensions. Gleam dominates the aesthetic, mathematical, human, and design axes. Practitioner Happiness is where the pair separates most cleanly — Gleam leads Lua by 3 points and that gap colours everything else on the page.

See also: Gleam vs PHP , Gleam .

Dimension-by-dimension analysis

Ψ Practitioner Happiness

Gleam 9 · Lua 6

Gleam wins Practitioner Happiness by 3 points — a real happiness advantage. Stack Overflow's #2 "Most Admired" at 70%. For a language that hit 1.0 in 2024, the community love is extraordinary. The compiler's error messages are famously friendly. Gleam has done the harder cultural work: tooling that delights, a community that welcomes, documentation that explains. Appreciated by game developers and embedded systems programmers. The embedding experience is seamless. But as a standalone language, the ecosystem is thin and the community is niche. The winner here invites the next generation of contributors without asking them to earn it first.

Σ Conceptual Integrity

Gleam 9 · Lua 7

Gleam wins Conceptual Integrity by 2 points — a decisive philosophical edge. "Radical simplicity." Every feature omission is a deliberate design statement. Louis Pilfold's vision is crystal clear: a language where the right thing is the only thing. Few languages this young have this much conceptual integrity. The design philosophy of Gleam feels inevitable, each feature a consequence of one idea — Lua feels assembled from several good ideas instead of from one great one. "Small, fast, embeddable." Lua knows exactly what it is and stays in its lane. The design is coherent and focused. Docked slightly because the minimalism is more pragmatic than philosophical — it's simple because it needs to be small, not because simplicity is the point. The winner's philosophical discipline is what keeps its idioms stable as the language evolves.

Γ Organic Habitability

Gleam 8 · Lua 7

Gleam edges Lua by a single point on Organic Habitability; the practical difference is slim but real. No null, no exceptions, no implicit behavior means fewer surprises as codebases grow. The radical simplicity is itself a growth-point philosophy, less to go wrong, more room to extend. On extensibility the two are close enough that the decision rarely hinges on this axis alone. Lua's tiny footprint and simple embedding API make it exceptionally habitable in its niche, you can drop it into any C/C++ project. Metatables allow organic extension. Code accommodates change well within its scope. In high-level work, the language that welcomes modification wins the decade, not the quarter.

Λ Linguistic Clarity

Gleam 7 · Lua 6

Gleam edges Lua by a single point on Linguistic Clarity; the practical difference is slim but real. Explicit, predictable, and readable. Every value is named, every path is visible. Not as fluent as Ruby or Elixir in "reads-like-prose" terms, but the absence of magic makes intent self-evident. The difference is real but modest — pick either and a team will read fluently within weeks. Lua reads simply and directly for small scripts. The table-as-everything paradigm is clear once understood. Docked because the lack of distinct data structures (no arrays, no classes, just tables) can make larger codebases harder to read. For application code the clarity advantage is the whole point of the language category.

Ω Mathematical Elegance

Gleam 6 · Lua 5

Gleam edges Lua by a single point on Mathematical Elegance; the practical difference is slim but real. Deliberately simple, no higher-kinded types, no advanced abstractions. Gleam trades mathematical power for clarity. The design is intentional, but it limits the ceiling for algorithmic elegance compared to Haskell or OCaml. The elegance gap is narrow enough that idiomatic style often matters more than the language itself. Lua is deliberately simple. Tables as the single data structure are elegant in concept, but the language doesn't provide tools for abstract mathematical expression. Practical economy rather than mathematical economy. In application code the elegance edge shows up as less boilerplate per idea.

Φ Aesthetic Geometry

Gleam 8 · Lua 7

Gleam edges Lua by a single point on Aesthetic Geometry; the practical difference is slim but real. Clean syntax with no semicolons, no null, no exceptions. The visual layout is consistent and uncluttered. Gleam code has the proportional clarity of a well-organized document. Gleam edges ahead on visual rhythm, but Lua is comfortably readable in its own right. Lua's minimal syntax, function, end, local, tables, creates clean, visually proportional code. The lack of punctuation noise gives it a quiet, uncluttered feel. Small but well-composed. For application code the geometry translates directly into readability for new contributors.

Code comparison

The characteristic code snippet that best represents each language.

pub fn main() {
"Hello, Joe!"
|> string.uppercase
|> io.println
}
Lua
local Vector = {}
Vector.__index = Vector
function Vector.new(x, y)
return setmetatable({x = x, y = y}, Vector)
end
function Vector:length()
return math.sqrt(self.x^2 + self.y^2)
end
function Vector.__add(a, b)
return Vector.new(a.x + b.x, a.y + b.y)
end

Embedding expressions and variables within string literals.

import gleam/int
import gleam/string
let name = "Gleam"
let version = 1
let msg = "Hello, " <> name <> "! Version: " <> int.to_string(version)
let multi = string.concat([
"Welcome to ", name, ".\n",
"Version: ", int.to_string(version),
])
Lua
local name = "Lua"
local version = 5.4
local msg = string.format("Hello, %s! Version: %.1f", name, version)
local concat = "Hello, " .. name .. "! Version: " .. version
print(string.format("%-10s | %5.1f", name, version))

For/while iteration patterns and loop constructs.

import gleam/list
import gleam/io
pub fn print_items(items: List(String)) {
list.each(items, fn(item) { io.println(item) })
}
pub fn sum(items: List(Int)) -> Int {
list.fold(items, 0, fn(acc, n) { acc + n })
}
Lua
for i = 1, 10 do
print(i)
end
for index, value in ipairs(items) do
print(index .. ": " .. value)
end
local total = 0
while total < 100 do
total = total + 10
end

Frequently asked questions

Which is easier to learn, Gleam or Lua?
Gleam scores 9 on Practitioner Happiness versus Lua's 6. Stack Overflow's #2 "Most Admired" at 70%. For a language that hit 1.0 in 2024, the community love is extraordinary. The compiler's error messages are famously friendly. For a developer adding a new language to their toolbelt, the happier one is the one you will still be writing in six months.
Is Gleam or Lua better for developer happiness?
For developer happiness, Gleam has a clear edge — it scores 9/10 on Practitioner Happiness against Lua's 6/10. Stack Overflow's #2 "Most Admired" at 70%. For a language that hit 1.0 in 2024, the community love is extraordinary. The compiler's error messages are famously friendly.
Should I pick Gleam or Lua in 2026?
Gleam lands in the handsome tier at 47/60; Lua in the practical tier at 38/60. On this score difference the answer is clear: the higher-ranked language wins unless you have an explicit reason to pay the cost of the other.

Read the methodology →