Developer tools · data validation library
Malli
Hacker Approved
A Clojure library for runtime data validation and schema-based example generation; commenters prefer it to ordinary type systems for rigidity.
Summarized from 16 comments.
A Clojure library for runtime data validation and schema-based example generation; commenters prefer it to ordinary type systems for rigidity.
- recommend
- 15
- criticize
- 0
- months recommended
- 8 of 13
Why people love it
Runtime data validation beyond presence checks · 4
Tacking on malli (runtime type checking) or spec (types/contracts) helps LLMs avoid type problems altogether
May 2026 · commentIf you want to calcify something and add robustness, use clojure.spec or Malli.
Apr 2026 · commentvalidating the value properly rather than just checking for presence
Jul 2026 · commentMore expressive than ordinary type systems · 2
you can easily make those structural guarantees in a way that is more expressive than an ordinary type system
Nov 2025 · commentTheyre more feature-rich than types
Mar 2026 · commentGenerates example data and tests · 2
there's always something that needs paranoia, or it's handy to generate example data
Jun 2026 · commentgenerated tests based on Specs or Malli
Apr 2026 · commentHelps LLM coding agents avoid type errors · 2
The LLM has been pretty good at falling back to looking at the schema if tests fail because of validation issues.
May 2026 · commentTacking on malli (runtime type checking) or spec (types/contracts) helps LLMs avoid type problems altogether
May 2026 · comment
What hackers pick instead
- PydanticPython library that validates data against type-annotated models, popular with FastAPI and AI output. Critics call it slow, heavy and prone to breaking changes.62recommend
- ZodPopular TypeScript schema library that validates untrusted data at boundaries and infers static types. Critics cite added dependency weight, inferred-type quirks, and the reported 4.6.6 malware compromise.58recommend
- clojure.specBuilt 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.18recommend
- Guardrails AIDevelopers recommend it for forcing AI agents to pass tests and build checks, and for being simpler with less code. It is free software.5recommend
Every quote
The 14 most detailed of 16 comments. Each links to the original.
The LLM has been pretty good at falling back to looking at the schema if tests fail because of validation issues.
Recommends · May 2026 · in “ClojureScript Gets Async/Await”
you can easily make those structural guarantees in a way that is more expressive than an ordinary type system
Recommends · Nov 2025
Tacking on malli (runtime type checking) or spec (types/contracts) helps LLMs avoid type problems altogether
Recommends · May 2026 · in “ClojureScript Gets Async/Await”
there's always something that needs paranoia, or it's handy to generate example data
Recommends · Jun 2026 · in “My thoughts after using Clojure for about a month”
If you want to calcify something and add robustness, use clojure.spec or Malli.
Recommends · Apr 2026 · in “Bringing Clojure programming to Enterprise (2021)”
validating the value properly rather than just checking for presence
Recommends · Jul 2026 · in “Clojure 1.13 adds support for checked keys”
When need some rigidity - Spec/Malli are great.
Recommends · Nov 2025 · in “Experiment: Making TypeScript immutable-by-default”
generated tests based on Specs or Malli
Recommends · Apr 2026 · in “Clojure: Transducers”
Theyre more feature-rich than types
Recommends · Mar 2026 · in “Show HN: I built a self-hosted course platform in Clojure”
There are some _very good_ examples of (data-) DSLs provided by libraries
Recommends · Apr 2026 · in “Bringing Clojure programming to Enterprise (2021)”
you might throw schemas (eg. Malli) at pre 1.13
Recommends · Jul 2026 · in “Clojure 1.13 adds support for checked keys”
Case in point: spec vs. schema vs. malli.
Mixed · Apr 2026 · in “A Perfectable Programming Language”
generate a json schema with malli
Mixed · Sep 2026 · in “Using jq to format JSON on the clipboard”
malli is infinitely better
Recommends · May 2026
Counts from 1,795,640 Hacker News comments, Nov 2025 to Nov 2026. How we count · Report a mistake