# clojure.spec

18 Hacker News commenters recommended clojure.spec and 4 criticized it, November 2025 to November 2026. It was recommended in 9 of 13 months. It meets the Hacker Approved badge rule.

**Verdict:** Built into Clojure, spec lets people express structural guarantees more expressively than an ordinary type system. Critics say it mostly retrofits static typing onto a dynamic language.

## Why people recommend it

- More expressive than static typing (3 comments): "you can easily make those structural guarantees in a way that is more expressive than an ordinary type system" ([source](https://news.ycombinator.com/item?id=45786174)) "clojure.spec offers something that is even better than static typing (imo)" ([source](https://news.ycombinator.com/item?id=47531703)) "Theyre more feature-rich than types" ([source](https://news.ycombinator.com/item?id=47204560))
- Recommended for rigidity and robustness (2 comments): "If you want to calcify something and add robustness, use clojure.spec or Malli." ([source](https://news.ycombinator.com/item?id=47624768)) "When need some rigidity - Spec/Malli are great." ([source](https://news.ycombinator.com/item?id=45972977))
- Puts invariants in code (2 comments): "To put those invariants in code and not in your head is so liberating." ([source](https://news.ycombinator.com/item?id=49378304)) "Spec solves this by making each artifact self-contained." ([source](https://news.ycombinator.com/item?id=46616412))
- Works with existing map functions (2 comments): "Plus you get to leverage the million other functions that already work on maps" ([source](https://news.ycombinator.com/item?id=45824240)) "I religiously use spec'ed maps in my Clojure since a great many years" ([source](https://news.ycombinator.com/item?id=48810211))

## What people warn about

- Harsh criticism of its design (2 comments): "I think core.spec makes no sense" ([source](https://news.ycombinator.com/item?id=48082718)) "and the turd that is spec" ([source](https://news.ycombinator.com/item?id=47432102))

## Alternatives hackers recommend

- [Pydantic](https://hackerapproved.com/p/pydantic.md): 62 recommend
- [Zod](https://hackerapproved.com/p/zod.md): 58 recommend
- [Malli](https://hackerapproved.com/p/malli.md): 15 recommend
- [Guardrails AI](https://hackerapproved.com/p/guardrails.md): 5 recommend

## Cite as

Hacker Approved, "clojure.spec", https://hackerapproved.com/p/clojure-spec/ (counts from 1,795,640 Hacker News comments, November 2025 to November 2026).
