# Malli

15 Hacker News commenters recommended Malli and 0 criticized it, November 2025 to November 2026. It was recommended in 8 of 13 months. It meets the Hacker Approved badge rule.

**Verdict:** A Clojure library for runtime data validation and schema-based example generation; commenters prefer it to ordinary type systems for rigidity.

## Why people recommend it

- Runtime data validation beyond presence checks (4 comments): "Tacking on malli (runtime type checking) or spec (types/contracts) helps LLMs avoid type problems altogether" ([source](https://news.ycombinator.com/item?id=48064416)) "If you want to calcify something and add robustness, use clojure.spec or Malli." ([source](https://news.ycombinator.com/item?id=47624768)) "validating the value properly rather than just checking for presence" ([source](https://news.ycombinator.com/item?id=48815359))
- More expressive than ordinary type systems (2 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)) "Theyre more feature-rich than types" ([source](https://news.ycombinator.com/item?id=47204560))
- Generates example data and tests (2 comments): "there's always something that needs paranoia, or it's handy to generate example data" ([source](https://news.ycombinator.com/item?id=48377652)) "generated tests based on Specs or Malli" ([source](https://news.ycombinator.com/item?id=47865645))
- Helps LLM coding agents avoid type errors (2 comments): "The LLM has been pretty good at falling back to looking at the schema if tests fail because of validation issues." ([source](https://news.ycombinator.com/item?id=48063039)) "Tacking on malli (runtime type checking) or spec (types/contracts) helps LLMs avoid type problems altogether" ([source](https://news.ycombinator.com/item?id=48064416))

## Alternatives hackers recommend

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

## Cite as

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