The need for a formally verifiable mainstream programming language

17 points by florianhartung 20 hours ago on lobsters | 18 comments

There's an Ada forum topic from yesterday about why Ada's verifiable SPARK subset isn't being brought up in the same discussions as Lean and TLA+.

I have no formal methods training and have written verified programs in Ada/SPARK. It doesn't have true liquid or refinement types, but subtype predicates are super easy to understand and use. Verification runs off open source tooling (GCC/GNAT/Why3) and it plays super nice with LLMs.

FRIGN | 9 hours ago

+1 for Ada/SPARK

Ada is a silent giant that has been running our nuclear plants, planes, jets and critical infrastructure for decades. It's not hyped and its proponents are usually not loud about it. Ada speaks for itself.

Ada provides more guarantees than Rust, and often already at compile-time. Memory safety is just one element of formal verification, and Rust ends there and is mostly a normal systems programming language beyond that. While verus is available for Rust, it's just 'plugged in', whereas Ada has native support with contracts, etc. This is why I lament the strong push for rewriting things in Rust, when we could rewrite in Ada/SPARK and dial up the formal verification

It's also pretty clean; the consortium is not scared of deprecating stuff, unlike e.g. the mess we see with C++.

And Ada is aimed towards maximum readability and encourages the programmer not to write convoluted 'smart' stuff, which is what I often miss with Rust where the opposite is often the case.

As a PL nerd, I like the idea of Ada and SPARK, but a programming language that has you "request pricing" to use the compiler (source) is not very friendly to experiment with.

FRIGN | 3 hours ago

This is GNAT Pro, which has certifications etc. The GNAT core (compiler, prover, tools, etc.) itself is GPL and freely available. They need to make money somehow, don't they? GCC also has an Ada backend.

I don’t like that either but everything I’ve done is all free tooling. You don’t need the paid stuff and I’ve never used it.

FRIGN | 3 hours ago

Just to put this out there: This way of selling software (GPLed, with paid support/certification, etc.) is endorsed by the FSF. No one forces you to pay for anything, it's all free/open source.

My only issue is that they require you reaching out to get a price.

I don't work there (though I wouldn't mind working there), but I've had a lot of positive interactions with AdaCore employees over the years. AdaCore helped improve the support of these tools openly and for free, and have done a lot to support the Ada open source community.

Download and install Alire (free).

# install toolchains
alr toolchain --select 

# install prover tooling
alr install gnatprove

Congrats, you're now ready to prove with free tooling.

alr gnatprove -j12 --level=2 --steps=20000 --counterexamples=on 

F* extracting to OCaml is crazy good. It has both SMT backed refinement types and dependent types. There’s ADA as well. Liquid Haskell. Koka. ATS. Lean. So many options to evaluate before inventing something new.

earlier this month someone at our local functional programming group made the case that , well, lean itself is a perfectly serviceable general programming language!

Or at least the language itself has the right trappings. My impression is lots of the libs are still in the “lots of obvious and missing stuff” phase

Student | 15 hours ago

I don’t disagree but at the same time, we have at minimum verus verification of rust; frama-c; and key for Java https://www.key-project.org/

Stepping slightly out of the mainstream, we’ve got lots of formal verification systems and dependently typed programming languages.

Nevertheless in this year of our lord 2026, people are still writing new software in golang, Ruby, typescript, and Python, none of which are particularly suited to formal verification (and tbh I’m not quite sure why there are so many attempts at formal verification for golang but nothing that becomes mature).

People are even writing C programs without formal verification. I suspect that the children do not yearn for the formal verification and that everything is wedged in its ecological niche until something comes along that is better in every single way, cf the growth of rust growing in the same niche as C++.

Verdagon | 11 hours ago

If you happen to have experience in Verus, how is it?

Student | 5 hours ago

I don’t I’m afraid

bsdinis | an hour ago

I think its pretty good. You can do a lot with it. It gives a good mix of control and support for low level systems things and automation along the way. Certain things only come out of building a fuzzy intuition for how to debug proofs, but LLMs are pretty good at it and there is development in making it more user friendly.

(disclosure: Ive done quite a bit of work on verus itself)

JulianWgs | 10 hours ago

https://bend-lang.com/ sounds very similar to what the author is suggesting. I‘ve never used it.

adamshaylor | 8 hours ago

The first two links in the article citing its sources are broken, the second apparently presuming authentication credentials the general public wouldn’t have.

[OP] florianhartung | 7 hours ago

adamshaylor | 7 hours ago

Thank you very much!