Dafny
Dafny is a verification-aware programming language with a built-in static program verifier that compiles to C#, Java, JavaScript, Go and Python.
At a Glance
Dafny itself is licensed under the MIT license; free to download and use via binaries, CLI or VS Code extension.
Engagement
Available On
Listed Dec 2026
About Dafny
Dafny is an open-source verification-aware programming language developed by the dafny-lang organization. Specifications are written alongside code, and a static verifier checks the implementation against them as you type. Verified programs can be compiled to C#, Java, JavaScript, Go, and Python. The latest GitHub release listed is v4.11.0, published 2025-08-25.
What It Is
Dafny is a programming language and verification toolchain in one. Developers write code and specifications (pre- and post-conditions, loop invariants, termination conditions, read/write specifications) in the same language. The verifier uses automated reasoning to check that the code meets those specifications, shows counterexamples when it does not, and confirms when it does. The project states that this reduces late-stage bugs that testing may miss.
Language and Proof Toolbox
The language supports classes and trait inheritance, inductive and lazily unbounded (co-inductive) datatypes, subset types, generic types, lambda expressions, iterators, arrays, tuples, and mathematical and bounded integers, reals and bit-vectors. For proofs it offers bounded and unbounded quantifiers, calculational proofs, and lemmas.
Tooling and Workflow
The ecosystem includes several compilers, an LSP-based language server, IDE plugins, and a code formatter. A Visual Studio Code extension shows verification successes and failures in real time. Dafny can also be used from the command line. A standard library of functions and lemmas is available.
Learning Resources
The project offers a reference manual, an online tutorial, a quick reference, a video course on specification and verification basics, a blog, a Zulip community channel, and the book Program Proofs by Rustan Leino. Binary downloads are provided for Windows, macOS, GNU/Linux and FreeBSD.
Collections
Popular collections
- Frameworks
Collection by @joemseifi
- Let Your Agents Talk to Each Other
Collection by @leftchannel
- See What Your Agent Is Doing remix
Collection by @joemseifi
- Let Your AI Read the Document, Not Just the Words
Collection by @priyashah
Add Dafny to one of your collections.
Community Discussions
Be the first to start a conversation about Dafny
Share your experience with Dafny, ask questions, or help others learn from your insights.
Pricing
Dafny (open source)
Dafny itself is licensed under the MIT license; free to download and use via binaries, CLI or VS Code extension.
- MIT-licensed core (Coco subdirectory contains third-party material under separate license)
- Binary downloads for Windows, macOS, GNU/Linux, FreeBSD
- VS Code extension and LSP-based Language Server
- Compiles to C#, Java, JavaScript, Go and Python
Capabilities
Key Features
- Built-in static program verifier
- Pre- and post-conditions, loop invariants, termination conditions
- Real-time verification feedback with counterexamples
- Compiles to C#, Java, JavaScript, Go and Python
- Inductive and co-inductive datatypes, subset types, generics
- Calculational proofs, lemmas and quantifiers
- LSP-based language server
- Code formatter
- Standard library of functions and lemmas
Integrations
Demo Video

