<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/so-you-want-to-build-a-mainstream-formally-verifiable-language-ivfnvtdj0" -->

---
title: So You Want to Build a Mainstream Formally Verifiable...
description: Anyone designing a mainstream formally verifiable language faces a set of design questions, and this post lays them out as open questions. A key early choice...
canonical: https://daily.dev/posts/so-you-want-to-build-a-mainstream-formally-verifiable-language-ivfnvtdj0
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: So You Want to Build a Mainstream Formally Verifiable Language | daily.dev
og:description: Anyone designing a mainstream formally verifiable language faces a set of design questions, and this post lays them out as open questions. A key early choice...
og:url: https://daily.dev/posts/so-you-want-to-build-a-mainstream-formally-verifiable-language-ivfnvtdj0
og:image: https://api.daily.dev/og/posts/IvfnvtDJ0.png
og:image:alt: So You Want to Build a Mainstream Formally Verifiable Language
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# So You Want to Build a Mainstream Formally Verifiable Language

**[Hacker News](https://daily.dev/sources/hn)** · 33 min read · 2 upvotes · 0 comments

## Summary

Anyone designing a mainstream formally verifiable language faces a set of design questions, and this post lays them out as open questions. A key early choice is whether you build an object language to be analyzed or a metalanguage like TLA+ or Alloy. It surveys three logic families: temporal logic, separation logic, and higher-order dependently typed logic as used in Lean and Agda. Other issues include the specification gap, proof repair when code changes, and intrinsic versus extrinsic verification. The author observes that LLM agents handle tactics well but struggle to construct proof terms, so languages built on dependent types may need proper tactic support.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://danilafe.com/blog/verifiable_language>

## Questions this post answers

### What is the difference between intrinsic and extrinsic verification in formal methods?

Intrinsic verification embeds proofs in the program itself, so types, preconditions, and postconditions must be stated upfront and the code won't compile if specs break. Extrinsic verification keeps proofs separate, costing nothing upfront but risking drift between specification and code. Intrinsic proofs can be stripped by proof erasure to avoid runtime cost.

_Choosing a verification approach is easier when you follow formal methods discussions on daily.dev._

### Why do proof assistants like Lean and Agda avoid side effects?

Side effects break referential transparency, meaning you can't substitute a variable with its definition and expect identical behavior. That prevents the algebraic manipulation proofs depend on. Since these languages write code and proofs in one language, business code must be purely functional, with effects modeled through techniques like monads.

_Developers exploring functional programming and type theory keep up with it on daily.dev._

### Why do LLM agents seem to prefer extrinsic verification in Lean?

The author hypothesizes that LLM agents are very good at tactics but not good at constructing proof terms, which intrinsic correct-by-construction proofs require. The same weakness may explain why LLMs struggle with Agda, which lacks a well-developed tactic framework. This is anecdotal evidence rather than a confirmed result.

_Anyone building AI-assisted verification workflows can follow the tooling debate on daily.dev._

## Community take

How the wider developer community reacted, aggregated from 1 discussion and 71 comments across hackernews (as of 2026-11-30).

**TL;DR:** Much of the discussion turns into a debate about whether Lean is already the dominant mainstream-enough formally verifiable language, with some pushing back that new approaches (IR-level verification, graph-based languages, K Framework, SPARK/Ada) deserve more attention; there's also a philosophical side-thread about how proving programs differs from doing math.

**Sentiment:** 35% positive · 45% mixed · 20% skeptical

**The case for**

- Lean's unified dependent type system lets proofs be bundled into types and erased at compile time, seen as a major advantage.
- Lean is reported to be 1-2 orders of magnitude faster than Coq/Rocq and has a more ergonomic, accreting ecosystem (Mathlib).
- Delegating low-level I/O to Rust while using Lean for verification/business logic is seen as a pragmatic path to real-world use.
- Verifying at the IR level is argued to be promising since IRs have more regular, well-defined semantics than source code.

**The pushback**

- Lean is seen as hard to apply to software that deeply interacts with the OS/hardware or needs manual memory management.
- Verifying IR is fragile because small code changes or compiler upgrades can cause unpredictable changes in the IR, breaking proofs.
- Performance-relevant properties like cache locality and compiler optimizations are considered largely out of reach for current formal verification.
- The constant churn of real-world code (the 'everpresence of change') is viewed as the main practical obstacle to formal verification gaining traction.
- One commenter called the article weak for not addressing what properties developers actually want to prove about their software.

**By community**

- hackernews (mixed): Debate centers on whether Lean already fills the 'mainstream verifiable language' niche, alongside tangents on IR-level proofs, seL4, and math-vs-programming cognition, with broadly constructive but split opinions.

**Hottest debate:** Whether Lean already represents the mainstream formally verifiable language we need, or whether its weaknesses (systems/hardware interaction, model checking, network-effect lock-in) justify building something new.

**Open questions**

- Can formal verification be made to scale to performance-critical details like cache locality, SoA/AoS layout, and compiler optimizations?
- Is verifying at the IR level more tractable than verifying source code, despite IR instability across compiler changes?
- Can intrinsic (correct-by-construction, typechecker-enforced) verification scale broadly enough to avoid costly proof repair on every code change?

**Highlights**

> I agree with you in part, as I have lightly alluded to in my article. There's a lot to love! Lean's typeclasses + inference, metaprogramming, custom notation, "X implemented as Y" support, and much more are fantastic. It's not clear to me, however, that the space is completely filled. I find it hard to imagine using Lean for software that deeply interacts with the OS or hardware, or even just "doesn't refcount". Am I unaware of progress in this area? In a similar vein, in terms of practical software success, I think we've seen the most with model checking, yet Lean is not particularly amenable to this. It remains to be seen whether tactics and proofs (+ some sort of repair) will beat out the incumbent.
> — [danilafe on hackernews · 4 comments](https://news.ycombinator.com/item?id=50690204)

> One of the most interesting things is how Sel4 works -- IIUC they compile to arm64 assembler, and then run verification proofs on that.  I think that an interesting place to patch verification in to an existing language is at the IR level.  At the IR level, you have usually (effectively) a highly-regularized schema for all operations, that is usually still embued with semantic information (for example: the function you called is "malloc") that can be used to generate invariants that you'd like to prove (or refute).
> — [dnautics on hackernews · 3 comments](https://news.ycombinator.com/item?id=50690333)

> You write: > One of the most interesting things is how Sel4 works -- IIUC they compile to arm64 assembler, and then run verification proofs on that But that's not how seL4 works. The seL4 proofs are refinement proofs. No assembly is involved, and the verification work is done on the abstract mathematical spec, and the C implementation. Here's how it works: 1. They write a mathematical specification in Isabelle. 2. They prove good security properties about the mathematical specification. They show that a correct implementation of the specification wouls prevent applications running on top of it from modifying data without authorisation (integrity), from interfering with resource access of other applications (availability), and from learning information from other applications without explicit authorisation (confidentiality). 3. They prove (in Isabelle, an interacrive theorem prover) that a Haskell program refines an abstract Isabelle specification, then prove that the C implementation of seL4 refines the Haskell program. 4. They compile the C program using gcc, then prove (using an automated tool) that the machine code was compiled correctly. This works on ARM and RISC-V. Assembly is not involved in the proof, only machine code and C code. 5. Together, the chain of refinements in 3,4 imply that the running binary correctly implements the mathematical specification. Sincw the specification satisfies the good properties, so does the implementation. In other words, the seL4 KERNEL prevents applications running on top of seL4 from modifying data without authorisation (integrity), from interfering with resource access of other applications (availability), and from learning information from other applications without explicit authorisation (confidentiality). Together these security properties enforce the isolation of components running on top of the kernel, allowing critical components to securely run alongside untrusted software.
> — [saithound on hackernews · 1 comments](https://news.ycombinator.com/item?id=50690499)

> I think the only scalable approach will be in intrinsic verification If we put in the effort to design the right libraries/DSLs for correct-by-construction development, we do not need to trust the program writer. So a slop-machine can write whatever, and we can use typechecking to statically guarantee correctness. This is more robust to refactors and does not require a human or agent to do manual proof repair. Moreover, we pay much of the verification cost up front and then don’t need to do ad hoc work upon every instantiation of the framework I expect that if we as a community invest in the right abstractions now, we will see a flourishing of verified software
> — [stschaef on hackernews](https://news.ycombinator.com/item?id=50692368)

> I think there's a pretty big conceptual difference between programming and math, which is that in programming we think about building up something over time by applying successive steps. In math though we have to think about the whole thing simultaneously, forwards and backwards. So when we prove a program, we're actually proving it forwards and backwards, with all possible inputs and outputs, at the same time. And either it's all true, or it blows up in your face. Another difficulty is with programming, we succeed by making abstractions that don't leak, where with math we're constantly opening up mathematical objects and messing around with their internals, chaining together the internals with theorems to get to our desired outcome. Since we so often need access to the guts of the objects we're working with to prove facts, it makes it really hard to interoperate with other systems, because either we have to make assumptions about those systems which can compromise correctness or we have to be able to plug in all the way. Signed, an undergrad in math with decent coding experience.
> — [smj-edison on hackernews · 7 comments](https://news.ycombinator.com/item?id=50689051)

**Source threads**

- [hackernews](https://news.ycombinator.com/item?id=50687017) · 96 points · 71 comments

## Similar posts on daily.dev

- [The need for a formally verifiable mainstream programming language](https://daily.dev/posts/the-need-for-a-formally-verifiable-mainstream-programming-language-qepkcxbhy) · Hacker News · 0 upvotes · 0 comments
- [Programming languages for AI](https://daily.dev/posts/programming-languages-for-ai-knuqwjcd2) · ploeh blog · 9 upvotes · 1 comments
- [Prediction: AI will make formal verification go mainstream — Martin Kleppmann’s blog](https://daily.dev/posts/prediction-ai-will-make-formal-verification-go-mainstream-martin-kleppmann-s-blog-j1btzfnpe) · Lobsters · 2 upvotes · 0 comments
- [Intro to TLA\+ for the LLM Era: Prompt Your Way to Victory](https://daily.dev/posts/intro-to-tla-for-the-llm-era-prompt-your-way-to-victory-h8swpmvy2) · Hacker News · 0 upvotes · 0 comments

---

Tags: [#llm](https://daily.dev/tags/llm), [#type-systems](https://daily.dev/tags/type-systems)

[View this post on daily.dev](https://daily.dev/posts/so-you-want-to-build-a-mainstream-formally-verifiable-language-ivfnvtdj0)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"So You Want to Build a Mainstream Formally Verifiable Language","url":"https://daily.dev/posts/so-you-want-to-build-a-mainstream-formally-verifiable-language-ivfnvtdj0","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/so-you-want-to-build-a-mainstream-formally-verifiable-language-ivfnvtdj0"},"datePublished":"2026-11-29T17:57:54.452Z","dateModified":"2026-11-30T03:59:05.391Z","description":"Anyone designing a mainstream formally verifiable language faces a set of design questions, and this post lays them out as open questions. A key early choice...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/72e77986ee95f8a7f0fe9b8efb8ca5bb?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/72e77986ee95f8a7f0fe9b8efb8ca5bb?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Hacker News","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Hacker News","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/hn","url":"https://daily.dev/sources/hn"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/so-you-want-to-build-a-mainstream-formally-verifiable-language-ivfnvtdj0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"llm,type-systems","timeRequired":"PT33M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Hacker News","item":"https://daily.dev/sources/hn"},{"@type":"ListItem","position":3,"name":"So You Want to Build a Mainstream Formally Verifiable Language"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/so-you-want-to-build-a-mainstream-formally-verifiable-language-ivfnvtdj0#faq","mainEntity":[{"@type":"Question","name":"What is the difference between intrinsic and extrinsic verification in formal methods?","acceptedAnswer":{"@type":"Answer","text":"Intrinsic verification embeds proofs in the program itself, so types, preconditions, and postconditions must be stated upfront and the code won't compile if specs break. Extrinsic verification keeps proofs separate, costing nothing upfront but risking drift between specification and code. Intrinsic proofs can be stripped by proof erasure to avoid runtime cost. Choosing a verification approach is easier when you follow formal methods discussions on daily.dev."}},{"@type":"Question","name":"Why do proof assistants like Lean and Agda avoid side effects?","acceptedAnswer":{"@type":"Answer","text":"Side effects break referential transparency, meaning you can't substitute a variable with its definition and expect identical behavior. That prevents the algebraic manipulation proofs depend on. Since these languages write code and proofs in one language, business code must be purely functional, with effects modeled through techniques like monads. Developers exploring functional programming and type theory keep up with it on daily.dev."}},{"@type":"Question","name":"Why do LLM agents seem to prefer extrinsic verification in Lean?","acceptedAnswer":{"@type":"Answer","text":"The author hypothesizes that LLM agents are very good at tactics but not good at constructing proof terms, which intrinsic correct-by-construction proofs require. The same weakness may explain why LLMs struggle with Agda, which lacks a well-developed tactic framework. This is anecdotal evidence rather than a confirmed result. Anyone building AI-assisted verification workflows can follow the tooling debate on daily.dev."}}]}
```

