Dafny
Hacker ApprovedRanked 2 of 4 verification languages by recommenders
Recommended as a simple, approachable language for proving code correct, with executable output. Critics question its developer experience and production use.
Recommended as a simple, approachable language for proving code correct, with executable output. Critics question its developer experience and production use.
27 people gave an opinion
- recommend it
- 24
- criticize it
- 3
- approval share
- 89%
Recommended in 12 of 13 months
- November 2025: recommended
- December 2025: recommended
- January 2026: recommended
- February 2026: recommended
- March 2026: recommended
- April 2026: recommended
- May 2026: recommended
- June 2026: recommended
- July 2026: recommended
- August 2026: recommended
- September 2026: recommended
- October 2026: recommended
- November 2026: not recommended (month in progress)
Why it carries the badge
- 24 people recommend itNeeds 10 or more, met.
- 8 recommenders for every criticNeeds 2 to 1 or better, met.
- Recommended in 12 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
Simple and approachable to learn
“For software projects it seemed very approachable, even for a complete newbie like me.”
Comment from 30 Jul 2026 in “Are We Stuck with Lean?” “Dafny fits that bill quite well, it's simple, it offers refinement types”
Comment from 16 Dec 2025 in “AI will make formal verification go mainstream” “Dafny is really simple. The barrier of entry is low.”
Comment from 27 Nov 2025 in “Coq: The World's Best Macro Assembler? (2013) [pdf]” - Comment from 19 Feb 2026 in “Learning Lean: Part 1”
- Comment from 27 Apr 2026 in “"Why not just use Lean?"”
Well designed, efficient verification semantics
“Dafny's expressiveness tends to be more in the service of coherent specifications”
Comment from 17 Dec 2025 in “Dafny: Verification-Aware Programming Language” “The semantics of Dafny is carefully designed to make verification efficient.”
Comment from 17 Dec 2025 in “Dafny: Verification-Aware Programming Language” “The language is well designed for this.”
Comment from 17 Dec 2025 in “Dafny: Verification-Aware Programming Language” Expressive specifications and invariants
“in Dafny one can express much more complicated and complex invariants which get checked at build time”
Comment from 17 Dec 2025 in “Dafny: Verification-Aware Programming Language” “Dafny's expressiveness tends to be more in the service of coherent specifications”
Comment from 17 Dec 2025 in “Dafny: Verification-Aware Programming Language” “A verification language capable of enforcing invariants”
Comment from 6 Jan 2026 in “C Is Best” Named among serious verification languages
“Lean doesn’t have a monopoly on verification languages. Dafney, Rocq, Why3, ATS, Agda, Idris… these all can do it too.”
Comment from 4 Mar 2026 in “When AI Writes the Software, Who Verifies It?” “are definitely worthy of consideration”
Comment from 27 Apr 2026 in “"Why not just use Lean?"” “Dafny and F* are two good showcases”
Comment from 21 Feb 2026 in “Lean 4: How the theorem prover works and why it's the new competitive edge in AI” - Comment from 4 Mar 2026 in “When AI Writes the Software, Who Verifies It?”
Other verification languages people recommend
The three most recommended other verification languages, 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.
See all 4 verification languages, rankedWhat people said
34 of the 38 comments that mention it, newest first. Each links to the original comment.
“we should use a prover that has a lot more targets, like Danfy”
“makes for an inferior developer experience in my opinion and because in general you are pretty limited in expressiveness of propositions”
“I don't know if anyone actually uses it in production”
“tooling that allows code generation based on the formal proofs like FStart or Dafny”
“have good documentation if you want to try your hand at something”
“For software projects it seemed very approachable, even for a complete newbie like me.”
“I had fun in a college class that used Dafny, building a pseudo digital wallet, it wasn't the main focus of the class, so didn't get that much out of it”
“Dafny is not Rust. Using Dafny requires porting algorithms of interest from Rust to Dafny.”
“dafny + iris are the closest to being industrial I think”
“if execution is seriously required for your problem along with strong logic on the side”
“are definitely worthy of consideration”
“I found it more approachable.”
“Trying to deal with aliasing references in something like Dafny is a real pain”
“You don't need to interact with Dafny or the proofs at all.”
“Lean doesn’t have a monopoly on verification languages. Dafney, Rocq, Why3, ATS, Agda, Idris… these all can do it too.”
“it hits a very nice sweet spot”
“Looks like LLMs also find Dafny easier to write than Lean.”
“I can review Python code more quickly and accurately than Dafny”
“proving things correct in Dafny (for example) feels much more like programming”
“Dafny and F* are two good showcases”
“Dafny is really approachable and practical”
“A verification language capable of enforcing invariants”
“Dafny's expressiveness tends to be more in the service of coherent specifications”
“the mapping to other languages looks rather awkward for string types”
“Dafny gives you better tools to avoid this.”
“The language is well designed for this.”
“The semantics of Dafny is carefully designed to make verification efficient.”
“This allows an algorithm to be formally verified while still producing executable code.”
“in Dafny one can express much more complicated and complex invariants which get checked at build time”
“Reminds me of Eiffel, in a good way. Looks awesome.”
“Dafny fits that bill quite well, it's simple, it offers refinement types”
“I'd like to call out the work from Nada Amin in this area”
“Dafny is really simple. The barrier of entry is low.”
“Leftpad proofs using Rust Creusot, Dafny, or LiquidHaskell are quite straightforward”
Counts come from 1,795,640 Hacker News comments, November 2025 to November 2026. How we count. Report a mistake.