245 points | by akkad331 day ago
It's a great place to start with verification, as proofs are discharged to SAT/SMT, so things are automated. It can get a bit frustrating when automation is not able to prove things, that's the major disadvantage of SAT/SMT.
But it's not a toy. Some of the largest verification efforts have been done in Dafny. See e.g. IronFleet [1].
[1] https://www.andrew.cmu.edu/user/bparno/papers/ironfleet.pdf
I was skimming the "Proof-Oriented Programming" book, and it seems that the primary way to execute F* programs is by extraction or trusted compilation (same as Rocq and Lean, for example). Does F* have some special way to work directly with realistic source code that these other systems don't?
Lean is also a programming language with proof support. It is very much in the same category as F* in this regard, and not in the same category as Coq (Rocq).
How does Idris compare these days?
https://en.m.wikipedia.org/wiki/SPARK_(programming_language)
It builds on the Why3 platform which also supports Frama-C for the C language. IIRC, SPARK can be compiled to C for C-only, runtime targets as well.
This sounds like a very weird statement.
In my opinion, a proper proof-oriented language would inevitably contain a borrow checker variant as a subset of its functionality (assuming the language has notion of pointers/references and focuses on achieving "zero cost abstractions"). Lifetime annotations and shared/exclusive references provide essential information and code use restrictions which enable automatic proof generation.
After all, type and borrow checkers are nothing more than limited forms of automatic proof generation which are practical enough for wide use.
This seems to compile to native code if desired, so does that mean it’s faster than Lean?
Forgive me if these are obvious questions, I’m just curious and on my phone right now away from my machine.
Dafny, Isabelle, Why3, Coq and F* have been used to verify non-trivial software artifacts. Liquid Haskell, Agda and others are also interesting, but less mature.
[1] https://browncs1951x.github.io/static/files/hitchhikersguide...
For example their formal specification of their ledger system:
https://drops.dagstuhl.de/storage/01oasics/oasics-vol118-fmb...
Somebody managed to solve Advent of Code with Lean: https://github.com/anurudhp/aoc2022
Somebody managed to write a raytracer with Lean: https://github.com/kmill/lean4-raytracer
https://www.reddit.com/r/haskell/comments/76k1x0/what_do_you...
Googling "Fstar programming language" works fine for me.
Examples of both:
https://sumitkumarjha.com/papers/2023_ICAA_LLM_Dehallucinati...
I am hoping (a) is straightforward. For (b), I think most of us sense at least intuitively, with different strengths, that our current crop of programming languages are not really good enough. Too low-level, too difficult to get to a more compact and meaningful representation.
LLMs have kinda demonstrated the source for this feeling of unease, by generating quite a bit of code from fairly short natural language instructions. The information density of that generated code can't really be all that high, can it now?
So we have this issue with expressiveness, but we lack the insight required to make substantial progress. So we bounce around along the well-trodden paths of language design, hoping for progress that refuses to materialize.
Though I'd say we've been stuck since about the 80s.
It did happen over early things like IRC and the like, but the audience was limited, and the data was ephemeral.
For example, Byte Magazine has an article on writing your own assembler in 1977 [0]: "By doing it yourself you can learn a lot about programming and software design as well as the specs of your own microcomputer, save yourself the cost of program development, and produce a customized language suited to your own needs or fancies."
Programmers have been creating their own languages since the beginning. It's part of why we lean so heavily towards standards - so other people don't break the things we've already built.
[0] https://archive.org/details/best_of_byte_volume_1_1977_06
The things that’s changed is that these days you have a combination of more people using computers plus more convenient forums (like this) for people to promote their new language.
Even C# suffers from that, though it is a nice language.
For a programming language to have success it needs to be
* opensource * well maintained * first class citizen on win/lin/mac