So you want to build a mainstream formally verifiable language

100 points by mpweiher 15 hours ago on hackernews | 67 comments

tiffanyh | 13 hours ago

danilafe | 12 hours ago

Thanks, it's a case of low cognitive ease :)

I was aware of SPARK but not particularly familiar, and dropped it from my enumeration of relevant technologies unintentionally (though, the purpose of the post was not specifically to enumerate relevant tech). I really should read up on SPARK!

tiffanyh | 12 hours ago

This link might be useful, in particular the table comparison.

https://www.adacore.com/blog/should-i-choose-ada-spark-or-ru...

(I enjoyed your post btw)

danilafe | 11 hours ago

Thank you!

kccqzy | 12 hours ago

> I believe that one crucial distinction is preventing the meteoric ascent of AI in software of the formally verified kind: the everpresence of change.

This is actually also what I realized after a year or so in industry. (I was quite enamored of formal verification in college.)

rrook | 12 hours ago

I'd boil away all of the article's thoughts on "object" vs "meta" languages, and instead point out that all languages are expression of graphs. Once the language is built from this perspective, object language and meta language (using the articles terms) can exist happily together. This is actually the core thesis of my language project; all computation is situated in a global hypergraph.

danilafe | 12 hours ago

Say more! I'm familiar with expression graphs, and I know languages that are built on this, but it's not clear to me how this applies to formal proofs. Do you have more details?

rrook | 12 hours ago

Imagine like a graph with typed edges:

A ──f──> B ──g──> C

Any single proof can first be thought of as proving an assertion about the graph. "There exists a path from A to C that traverses g." From there, the proof is bog standard graph maths.

In the abstract, all expressions of logic are graphs, like...statements of graph state, mutation, comparison, relation, differentiation, etc. An expression of language can be an incomplete expression of a graph, and other expressions can fill in the missing pieces or assert things about it. The language can express both the computation and the logic we use to reason about that computation.

In a sense, proof languages typically operate this way. They build a graph, assert something about it, and prove it in the mathy-graphy-sense. Mainstream programming languages have not yet put the graph structures front-and-center in the language design, and in the gap between the two we feel friction.

soulofmischief | 12 hours ago

Nice, I'm also doing this to a degree with the language I've been building over the last year, proving as many facts as I can about the structure of the code, but my goal is to empower the compiler while allowing for terse, ergonomic code. Formal verification is in the back of my mind, but it isn't a language goal at this time. Instead, I'm focusing on more narrow validation, adopting Rust's "if it compiles it probably runs" ethos.

nylonstrung | 6 hours ago

I agree with you but am curious what you'd say makes graphs specifically the irreducible primitive.

The example you gave in the comment below is something that seems to me like it could be expressed in purely algebraic terms without explicitly invoking graphs or hypergraph as foundation.

Ericson2314 | 11 hours ago

Lean has already gone mainstream.

danilafe | 11 hours ago

It's not a bad choice! But I am yet to see any "real world software" written in it, in public or in private.

Ericson2314 | 11 hours ago

I wrote tic tac toe for the terminal in it :)

danilafe | 11 hours ago

I stand corrected :)

Ciantic | 10 hours ago

It definitely isn't bad choice, it reads a lot like Haskell. I've been exploring this myself too, haven't tried performance, but there are some Postgres / HTTP libraries for it.

Its macro capabilities make it very nice for SQL driven apps. I've been working one small invocing schema, and you can derive the Insert, Patch etc types with just macros with `deriving Patch` at the end of your type.

Also, one of my reasoning is that if these AI LLMs are tuned to work with millions of lines of Lean, it probably is very efficient for it.

nylonstrung | 9 hours ago

I'm very focused on the "real world software" use case for Lean. Right now it's pretty thin but Nick Palladinos has done some great work IMO

https://github.com/palladin/lean-linq https://github.com/palladin/lean-cloud

kzrdude | 10 hours ago

Why did Lean win over Rocq/Coq? It was popular first, then Lean overtook it.

logicchains | 10 hours ago

A more polished/user friendly design, and more suitable to formalizing math (built in quotients support). Also more efficient/faster.

armchairhacker | 8 hours ago

IME Rocq has more legacy quirks. For example, proof automation is done in LTac (very not composable and “spaghetti” but more support and documentation) and LTac2 (newer, confusing, still hard to compose). Inconsistent syntax and behavior, tactics unexpectedly failing (because they’re spaghetti). And maybe this was my poor skill, but even simple tasks were slow, just finding the right lemma, tactic, or syntax to apply them.

Lean:Rust::Rocq:C++

nylonstrung | 6 hours ago

Lean is a real programming language with the power and expressiveness you'd expect from that whereas Coq functions more like a theorem prover with an escape hatch

As a result of that and other choices Lean also felt more natural and ergonomic to mathematicians than Coq. And the early Lean community did a very good job at using this to build Mathlib which coalesced into a comprehensive library for reusable proofs and math concepts which compounded and built upon itself with standardized conventions

In contrast much of the Coq ecosystem's output has increasingly fragmented rather then accreting like Lean's has

It also helps that Lean is uniformly 1-2 orders of magnitude faster than Coq, partially because it compiles to C

smj-edison | 11 hours ago

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.

random3 | 9 hours ago

As a computer scientist with 20 years experience in software and last 3 shifting on math, I think I agree with how you describe the approach in SWE. I collected a ton of notes on the same process myself.

I'd sum it up as starting to code before/without trying to get a proper* understanding of the end-to-end problem, and then incrementally adjusting along the way. This often solves a chicken and egg problem, of not being able to advance understanding before building. The problem is not rewriting or fully refactoring the code once your understanding persist. Often this is too late (aka "shipping the prototype"). Then everything expands into more complexity over more or less** time.

I think this whole process can actually be described formally. I'm not sure how much it matters anymore, but I suspect agent generated code suffers from the same issue, just with different measures due to speed/memory advantages agents have.

----

* I say "proper" assuming "full" is likely unachievable in most settings

** the difference between many software projects can be reduced to how fast they become dead ends based on how fast complexity explodes.

latentsea | 8 hours ago

> Another difficulty is with programming, we succeed by making abstractions that don't leak

So, we basically fail then.

somethingsome | 7 hours ago

While I like your dichotomy, I find more similarity between maths and programming.

you usually define the internals of your mathematical object based on the requirements of the 'rest of the system' and then you study the objects a lot to see it they even make sense or collapse.

As soon as you have an object that does not collapse, you know you can use it.

Take for example measure theory, you start with the basics axioms that are there to make the measure useful to others, then, based on the axioms you derive everything that you need to ensure that it's well defined, and then some more theorems that are like glue code to be able to use that measure for particular cases.

In this view, the axioms are your basic API, and the 'glue' theorems for an application are your frameworks.

Now a big difference between maths and programming is that maths is way bigger and more complex though

kenferry | 5 hours ago

I think you're not wrong about the situation today, but that doesn't mean we cannot change things. Verifiability is an exciting possibility that may be enabled by LLMs.

I also somewhat disagree with you about abstraction. In programming as well we move "up and down the ladder of abstraction", which means opening up objects and revisiting how we've built their abstractions. If you're doing performance work or debugging, while you don't exactly IGNORE abstractions, you're definitely opening them up.

Signed, professional software engineer with math degrees. :)

smj-edison | 20 minutes ago

I guess my point wasn't that it's not possible to formally verify programs as much as it exercises a different part of your brain. Doing math feels different for me, because I'm constructing the whole thing in its entirety in my mind at once, and I can poke at it and follow strands in a different way.

Of course, when I have a good design for a program I also have a mental map of how it all connects, but the methods I use to morph a problem in programming is sequential and directed in a way, where proof by contradiction or contrapositive feels very different.

kccqzy | 3 hours ago

I disagree. In writing a proof in math you also apply successive steps. This is clear in a proof written in English, and even clearer in a Lean proof where you literally list the steps (tactics) in order. The forward and backward thing you are talking about is probably about proving A if and only if B; that’s a small category of proofs. A small category of programming tasks (like parsing and pretty printing) also need the programmer to think forwards and backwards.

The idea of making abstractions comes from mathematics. The entire field of algebra is just abstractions. Algebraists think about the group, the ring, the field rather than the underlying objects. These abstractions absolutely don’t leak. These are some of the most elegant abstractions available, and this style of abstractions is known as type classes (in Haskell) or traits (in Rust), and is far superior to programmer-derived object-oriented abstractions. Why do most programmers create abstractions that leak? Because they are only taught object-oriented programming and yet without even learning about the Liskov substitution principle.

smj-edison | 31 minutes ago

> The forward and backward thing you are talking about is probably about proving A if and only if B

I'm aware about bidirectional implication, but that's not quite what I'm getting at. With programming I think in terms of starting with some input data, successively applying calculations, and then ending with a result. There's a step-by-stepness to it. With math I have to think of it existing in all ways, simultaneously. Equality works both directions, but variable assignment doesn't. Math functions go both ways (at least when they're bijective), but programming functions only go one way. Maybe I haven't done enough math yet, but it hurts my brain in ways that programming never has. I don't usually program contrapositively or by contradiction.

And it's true that math arguments are presented linearly, but that's because there's not really another way. I have to reconstruct the mathematical framework from the linear presentation, but it hardly feels linear once it's all brought together in my head.

> The entire field of algebra is just abstractions.

I'm afraid I haven't taken abstract algebra yet, that'll be next semester! But I hadn't considered about how algebra works with objects that satisfy certain properties, so I'm glad you've brought that up. Thus far I've mainly been done proofs in linear algebra and my intro to proofs class, so that certainly colors my understanding.

yehoshuapw | 3 hours ago

Have you programmed in haskell? Because I disagree in general, and haskell takes it furthur: you program declaratively

smj-edison | 23 minutes ago

I haven't programmed much in Haskell, but I have played around with Elixir and Clojure before, so I have a rough sense of programming declaratively (I'm not terribly familiar with Haskell's type system outside of my exposure to traits in Rust, but I don't think that was the feature you were focusing on). Programming declaratively from what I've done is still thinking downwards, in that you map this, you filter this, etc, but it's a directed graph. With math you have equality/equivalence, which works both ways. If a + b = c + d, then c + d = a + b, so now you can go backwards. In my experience it feels completely different, because the way you solve problems takes advantage of things like this all the time.

NatKarmios | 39 minutes ago

Interestingly, for the kinds of proofs on programs I'm familiar with (as someone who works in the separation logic world), the notion of proving a program backwards and forwards are two different things; we generally use a forward proof (hoare logic / separation logic) for correctness (this program doesn't deviate from the spec / has no bugs) and a backward proof (incorrectness logic) for incorrectness (this program can exhibit a certain bug)

nylonstrung | 9 hours ago

We don't need a new verifiable language, everyone trying to build new ones is suffering from NIH in my opinion.

Lean is already an extremely powerful and performant FP whose capability is essentially a superset of all other FPs and which has the most powerful metaprogramming and DSL building features outside of Racket

It has massive, likely insurmountable network effects in terms of the lemmas already written for it which can be reused in general purpose contexts

What we need is more libraries, frameworks, contributions to Core and Batteries which make it more useful outside of the domain of pure proofs and mathematics which has obviously been the focus so far.

danilafe | 9 hours ago

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.

jeremyjh | 9 hours ago

I really liked your article, and I haven't read or absorbed all of it yet but I agreed with your points on this topic.

I think Lean could perhaps serve in most server application use cases (and many others - roughly any use case where you could use Haskell), and Aeneas or something like it could leverage Lean only for verification. https://lean-lang.org/use-cases/aeneas/

danilafe | 8 hours ago

Absolutely. Libraries like servant in Haskell, too, relied on extensions to the language (was it data kinds and GADTs?) to make for some very, very sleek abstractions. Lean comes with these language features, but in a single unified type system, and it has even more goodies!

jeremyjh | 8 hours ago

What was surprising to me is that (at least some) Lean code is easier to understand than the machinery behind Servant, since you are just using normal code to operate on types.

nylonstrung | 8 hours ago

This to me is the single most mindblowing part of Lean that has not been fully taken advantage of yet: that types themselves are first class and fully programmable in a way indistinct from normal code

And it compounds with Lean's dependent type system and the ability for proofs to be "bundled" into said dependent types and then erase at elab time

erichocean | 9 hours ago

I'm doing Lean 4 certificates for Armv9 assembly. It's doable.

Update: Google did something similar here: https://deepmind.google/blog/introducing-alphaproof-code/

nylonstrung | 8 hours ago

Great article BTW, I think it was incredibly detailed and well written

> I find it hard to imagine using Lean for software that deeply interacts with the OS or hardware, or even just "doesn't refcount".

This is true: my thought is that the path to using Lean for "practical software" looks like delegating a lot of stuff like I/O to Rust libs. Lean will soon be able to compile to LLVM IR instead of just C and IMO it makes more sense to think about how to fill the gaps with the smartest cross-lang approaches rather than to rebuild a lot of basic stuff as pure Lean

danilafe | 8 hours ago

Thank you for your kind words!

> my thought is that the path to using Lean for "practical software" looks like delegating a lot of stuff like I/O to Rust libs. Lean will soon be able to compile to LLVM IR instead of just C and IMO it makes more sense to think about how to fill the gaps with the smartest cross-lang approaches rather than to rebuild a lot of basic stuff as pure Lean

I think this is the sort of approach we should pursue to make progress towards verification as an industry. But every time I write low-level code, and have to think through complicated cases, I feel that it is there that I need the most help. That's when I dream of a tool that can meet me at my level of abstraction and help me lean on rigor and verification. This is part of why mainstream verifiable languages have been on my mind personally, and I admit this implicit bias may affect the focus of the article and original claims.

kccqzy | 3 hours ago

I think one aspect that real software cares a lot more but hard to formally verify is performance. Basic big-O is in the realm of mathematics and doable, but important details like cache locality, SoA versus AoS, compiler-guaranteed tailcalls and compiler-guaranteed strength reduction are all aspects that need to be tackled before we can formally verify software.

dnautics | 9 hours ago

> capability is essentially a superset of all other FPs

Is that what we really want? For SW verification you mostly want "just plain logic" and really "set theory" is enough. Sure, the result will be more verbose, but do we care anymore now that the LLMs are writing so much of things? We should pivot to one where these two properties hold:

1. The bridge between the code and the proof is obvious

2. The proof is easily checkable by a human. That could mean more verbose, if you don't elide logical step or steps where the prover goes and looks for a theorem that satisfies the assertion.

jeremyjh | 8 hours ago

The article addresses this - there are two different models and they have different pros and cons - probably there is not a single model that is best for every use case. Lean - used alone - would be the intrinsic model. Lean, or another formal language, bridged to a programming language (like the Aeneas project with Rust https://lean-lang.org/use-cases/aeneas/) would be the extrinsic.

I haven't gotten far enough into this to really speak knowledgeably about this, but my intuition suggests that the intrinsic model has some significant advantages - specifically it encourages/forces you to model all your invariants in a dependent type system in the first place, and then you can prove things about the interaction of those invariants in a higher abstraction layer that is continuously checked as the program evolves.

A language without a dependent type system is significantly constrained in the invariants it can prove in its type system alone - perhaps there are properties you'd have to prove with (pure) unit tests to supplement the type system, and this further constrains design.

dnautics | 8 hours ago

> A language without a dependent type system is significantly constrained in the invariants it can prove in its type system alone

I mean, no? Sure, you can't prove that some user function doesn't make a syscall that under the hood allocates on page, for example, but you can certainly derive invariants (like safety guarantees) based on stdlib usage, and report if a stray syscall or ffi occurs for manual review. You could also maintain a list of "cleared" syscalls/ffis that the prover should just ignore moving forward.

As for other things, you're going to have to annotate your software in general. Be that in comments, some sort of metadata tag, even some in-tree manifest file. For example rust does not encode "this is a database call" in its type system. So if you want to instrument your code to verify that no consistency errors can occur (for example, not wrapping a read-modify-write in a transaction) you can't just do it by analyzing the language, you'll have to write your "own plugin". That's why having access to the IR (versus the asm) is better, because you have access to metadata that gets chucked out the window when it goes to asm.

jeremyjh | 7 hours ago

> For example rust does not encode "this is a database call" in its type system.

Right, and some languages - like Lean - can do that.

nylonstrung | 8 hours ago

My personal thesis and hope is that Lean's real value is being an extremely useful general purpose pure functional language a that, unlike Haskell etc, has a genuine "wedge" and superpower in the form of proof solving

I think all the capability it has to verify software and improve correctness are realized far more fully and elegantly if the software itself is built with Lean. Ironically, much of the of software verification by proof it's known for can be rendered unnecessary IMO because for example typechecker itself can enforce correctness by construction

"Come for the verification, stay for the type system and metaprogramming." At the very least the proof/verification usecase has resulted in hundreds of millions poured into Lean-centric startups like Harmonic and LLM post-training which gives it an advantage no other existing functional language has had or will ever have.

jeremyjh | 9 hours ago

The author acknowledged that. I recently discovered this on my own and was surprised to learn that:

* Lean 4 is self-hosting

* Lean has monadic I/O, do notation, type classes and other Haskell inspired syntax and language features.

* There is at least one guy building infrastructure fundamentals for web app development: https://github.com/paulbutcher?tab=repositories&q=&type=&lan...

* If you know and like Haskell, Lean is quite approachable (at least initially).

* Dependent types can be much easier to understand than the capabilities possible with the many different type extensions in Haskell. For example, lean-pq has compile time verification of usage of table schemas (that are defined in code) and the machinery for that is very simple to understand compared to the various Haskell libraries that achieve this (click the Try it link at the bottom of the README section on this at https://github.com/typednotes/lean-pq#compile-time-column-ve...)

latentsea | 8 hours ago

Another HNer shared this recently too

https://github.com/kbr-/kotlean

blacksqr | 9 hours ago

Eiffel was designed from the start to be formally provable.

A subset of Ada (SPARK) is formally provable.

Both are relatively easy to learn and use.

Options to produce better code have been available for a long time.

The more interesting and perplexing question to me is why weren't they brought into the mainstream decades ago?

And what will have to change for them to get serious consideration?

It seems to me that even total evisceration of existing code by LLMs has not been enough to prompt meaningful reconsideration in the mainstream of how programs are developed.

dnautics | 9 hours ago

for spark, it was probably that ada compilers were closed source for a long time when c/c++ was already in its gcc era.

dnautics | 9 hours ago

One of the most interesting things is how Sel4 works -- IIUC they compile to arm64 assembler, and then run verification proofs on that.

Inspired by 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).

Of course you still have to trust that the IR->ASM part of the compiler is good, but at least the program logic has been verified.

saithound | 8 hours ago

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.

dnautics | 8 hours ago

thanks for the correction! I do maintain that checking the IR is better than checking the code. For C, for example, not having to deal with #defines is by itself enough to make it a reasonable target. In a way I'm glad I got the seL4 methodology wrong.

saithound | 3 hours ago

It's a tradeoff. Writing proofs for the IR is great until you ever need to change the software.

A small change in the code can trigger quite radical and unpredictable changes in the IR. In fact, the IR can change without ever touching the code, e.g. when you update to a newer compiler.

danilafe | 8 hours ago

This is an interesting idea. At its core, IRs tend to be smaller and have better defined semantics. Of course, you'd have to use something other than the IR itself as the metalanguage (not a problem, though). Perhaps the reason this hasn't been attempted as often (I read the sibling Sel4 discussion about refinements) is twofold:

1. The mechanical effort required to show that the IR satisfies some abstract specification. Sel4 requires several refinement proofs (I am trusting the sibling comment on this), which suggests a great deal of effort. Perhaps LLMs (taken as "smart heuristics for proof code generation") can be of use here.

2. IR serves a secondary purpose as a target for compiler transformations. I've written myself about formally verifying compiler analyses[1] and I've proven a rudimentary LICM optimization in Lean based on these analyses (I haven't had a chance to write that one up), but it took a great deal of effort. We may then be forced either not to optimize or to trust something like LLVM (but...here be dragons? :P ).

So there is a tension between "simple core language" and "mutable substrate for optimization". And that doesn't even bring into question MLIR dialects and progressive lowering!

[1]: https://danilafe.com/series/static-program-analysis-in-agda/

dnautics | 7 hours ago

true. I should have been more careful. it does depend on the nature of the IR, modern languages have many layers of IRs. For example, I have made some progress interpreting Zig's "AIR" which is in the sweet spot where it doesn't yet launch into an LLVM-level "mutable substrate for optimization". Now, what I have is currently entirely heuristic, but I'm considering patching a theorem prover in to it.

https://github.com/ityonemo/clr

danilafe | 7 hours ago

Very interesting, thank you for sharing!

nylonstrung | 6 hours ago

Your intuition here seems to be correct: when it comes to Rust verification, essentially all the projects (Aeneas, Kani, Miri, Cruesot, Prusti) specifically target MIR

imtringued | 8 hours ago

This is a pretty bad article because it starts with irrelevant technical details and doesn't even spend a minute asking itself what a developer might even want to prove about their software. Instead, the assumption is that you want tomprove everything about the program, which leads to going down irrelevant rabbit holes and completely failing to live up to the title.

If you want to go mainstream you need to be able to convince users that they can prove useful properties about their software and so far the article has managed to entirely avoid that topic.

danilafe | 8 hours ago

Have you seen https://blainehansen.me/post/mainstream-verifiable-language/ and the resources it links, which were a part of the inspiration for the OP article?

nylonstrung | 6 hours ago

Every week now for months here there have been multiple articles posted about formal software verification, especially following the Signal protocol verification efforts

There's really no need to argue at this point that "users can prove useful properties about their software" and I think this article was good specifically because it didn't retread this topic yet again and instead focused on the technical details that the discourse specifically is missing right now

budro | 7 hours ago

I've always been dissatisfied with formal verification, mostly because I never know what I'm building until I have it in front of me. I really appreciate how the non-formal methods allow for that. They also inherently check the artifact instead of the specification, meaning you don't necessarily need to formally verify your compiler or OS, simply running the program enough will give you a lot of confidence that it works as expected. Integration testing and fuzz testing (and in the limit, something like Antithesis [1]) is vital for actually achieving that though, along with consistent use of assertions.

Although that all being said, I think you could do verification in addition to everything I mentioned before if that "gradually verified language" open question in the blog post was satisfactorily answered. SPARK and Verus seem popular so I'll definitely have to look into them.

[1] https://antithesis.com/

bbminner | 5 hours ago

Here's what I've been thinking about lately. Many problems in constrained optimization can be solved much more easily if you know *which* constraints to the solution are actually important and how their relative importance looks like (dual variables). A similar effect can be found in learning - it could be framed as identifying relative importance of training examples. Both of these approaches are "soft" in that they allow exploration steps to venture into technically invalid states to "get a feel for where the problem gives and where it does not", and arrive to the final conclusion by summarizing this knowledge.

It appears that proper summarization of how much soft constraints push against invalid but promising attempts works better than hard constraining the search to the valid solution space.

Despite how promising it sounds, if one were to design a language that does not allow you to express certain types of harmful patterns or code that disagrees with coders intent, it might constraint one to a search space so narrow that searching it would become too hard.

It feels like TLA+ and rust borrow checker are more of a hard constraint. I am not sure what would count as soft constraints here through? A very smart linter that takes your smart expression of the guarantees for different parts of the code and checks them against guarantees provided by the implementation? But that's kinda like what rust checker does. Not sure how to make it even softer..

stschaef | 5 hours ago

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

lopatin | 5 hours ago

I've been toying with adding verifiable contracts to TypeScript + React and I've had a lot more luck with K Framework than Lean, Dafny, or TLA+ as backends.

They already have published formal specs for JavaScript among other main stream languages. You can combine that with this paper for formal semantics of React hooks: https://dl.acm.org/doi/10.1145/3763067?__cf_chl_tk=xOyr8JU2v...

Cyphase | 4 hours ago

From a couple days ago; TFA links to that FA.

The need for a formally verifiable mainstream programming language - https://news.ycombinator.com/item?id=50663089 - November 2026 (343 comments)

summarity | 3 hours ago

You don't need a new language, you can adopt any of those tools to work with yours. Case in point, here's a detailed writeup of how I did this for Nim, which caught multiple classes of bugs in my code and the standard library: https://summarity.com/single-source-models