clojure.spec
Hacker ApprovedRanked 3 of 5 data validation libraries by recommenders
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.
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.
22 people gave an opinion
- recommend it
- 18
- criticize it
- 4
- approval share
- 82%
Recommended in 9 of 13 months
- November 2025: recommended
- December 2025: recommended
- January 2026: recommended
- February 2026: not recommended
- March 2026: recommended
- April 2026: recommended
- May 2026: recommended
- June 2026: recommended
- July 2026: recommended
- August 2026: recommended
- September 2026: not recommended
- October 2026: not recommended
- November 2026: not recommended (month in progress)
Why it carries the badge
- 18 people recommend itNeeds 10 or more, met.
- 4.5 recommenders for every criticNeeds 2 to 1 or better, met.
- Recommended in 9 of 13 monthsNeeds 4 or more, met.
The same three rules apply to every product, and the badge can’t be bought. How the badge works
What people say about it
The reasons people give, with the number of comments that give each one. Open a reason to read what they said.
Why people recommend it
Each mark is one comment
More expressive than static typing
“you can easily make those structural guarantees in a way that is more expressive than an ordinary type system”
Comment from 1 Nov 2025 on Hacker News “clojure.spec offers something that is even better than static typing (imo)”
Comment from 26 Mar 2026 in “Swift 6.3 Released” “Theyre more feature-rich than types”
Comment from 1 Mar 2026 in “Show HN: I built a self-hosted course platform in Clojure” Recommended for rigidity and robustness
“If you want to calcify something and add robustness, use clojure.spec or Malli.”
Comment from 3 Apr 2026 in “Bringing Clojure programming to Enterprise (2021)” “When need some rigidity - Spec/Malli are great.”
Comment from 18 Nov 2025 in “Experiment: Making TypeScript immutable-by-default” Puts invariants in code
“To put those invariants in code and not in your head is so liberating.”
Comment from 20 Aug 2026 in “A theory for decades of C vulnerabilities” “Spec solves this by making each artifact self-contained.”
Comment from 14 Jan 2026 in “Show HN: Spec – A language-agnostic IR for LLM agents (live demo)” Works with existing map functions
“Plus you get to leverage the million other functions that already work on maps”
Comment from 5 Nov 2025 on Hacker News “I religiously use spec'ed maps in my Clojure since a great many years”
Comment from 6 Jul 2026 in “Clojure 1.13 adds support for checked keys”
What people warn about
Each mark is one comment
Harsh criticism of its design
“I think core.spec makes no sense”
Comment from 10 May 2026 on Hacker News “and the turd that is spec”
Comment from 18 Mar 2026 in “Type systems are leaky abstractions: the case of Map.take!/2”
Other data validation libraries people recommend
The four most recommended other data validation libraries, with the same counts for each, so you can compare like for like. The tick on each bar marks the 2 to 1 line the badge needs.
| Product | Recommend | Criticize | Approval | Months | Owned | Badge |
|---|---|---|---|---|---|---|
| Pydantic | 62 | 15 | 81% | 10 | — | Approved |
| Zod | 58 | 20 | 74% | 11 | — | Approved |
| clojure.specThis page | 18 | 4 | 82% | 9 | — | Approved |
| Malli | 15 | 0 | 100% | 8 | — | Approved |
| Guardrails AI | 5 | 1 | 83% | 7 | — | — |
What people said
22 of the 25 comments that mention it, newest first. Each links to the original comment.
“To put those invariants in code and not in your head is so liberating.”
“a comprehensive score like what Geekbench and SPEC provide is valuable”
“there are better solutions to this problem that already exist, such as using spec/malli”
“I religiously use spec'ed maps in my Clojure since a great many years”
“many people use `spec` to sort of retrofit static typing”
“I think core.spec makes no sense”
“Tacking on malli (runtime type checking) or spec (types/contracts) helps LLMs avoid type problems altogether”
“generated tests based on Specs or Malli”
“That's a genuine design space with genuine ideas in it, regardless of whether you like dynamic typing.”
“Tape-patches for self-inflicted language design issues isn't innovation, lol”
“A spec does similar (and it does make it easier to seek through the source to find it).”
“There have been some abortive attempts at solving this with things like spec”
“If you want to calcify something and add robustness, use clojure.spec or Malli.”
“There are some _very good_ examples of (data-) DSLs provided by libraries”
“clojure.spec offers something that is even better than static typing (imo)”
“and the turd that is spec”
“Theyre more feature-rich than types”
“Spec solves this by making each artifact self-contained.”
“Spec is definitely underrated here considering it's built into the language and has a wider scope”
“When need some rigidity - Spec/Malli are great.”
“Plus you get to leverage the million other functions that already work on maps”
“you can easily make those structural guarantees in a way that is more expressive than an ordinary type system”
Counts come from 1,795,640 Hacker News comments, November 2025 to November 2026. How we count. Report a mistake.