logoalt Hacker News

pfdietzyesterday at 12:36 PM5 repliesview on HN

I might add another class of languages: those intended to express proofs, via the Curry-Howard correspondence. Lean is a primary example here. This could be considered a subclass of functional languages but it might be different enough to warrant a separate class. In particular, the purpose of these programs is to be checked; execution is only secondary.


Replies

armchairhackeryesterday at 1:12 PM

Theorem proving and complex types are like extensions on an otherwise ordinary language:

- Agda, Idris, etc. are functional languages extended with complex types

- Isabelle, Lean, etc. are functional languages extended with complex types and unreadable interactive proofs

- Dafny etc. are imperative languages extended with theorems and hints

- ACL2 is a LISP with theorems and hints

Related, typeclasses are effectively logic programming on an otherwise functional/imperative language (like traits in Rust, mentioned in https://rustc-dev-guide.rust-lang.org/traits/chalk.html).

show 1 reply
zozbot234yesterday at 7:22 PM

These are not true programming languages because by definition they are not Turing complete. If they were Turing complete it would be possible to write a false proof that just compiled down to a non-terminating program.

show 1 reply
User23today at 1:09 AM

This is all of them, properly speaking.

Incidentally, this is pretty much what Algol 60 was designed for and why to this day many academic papers use it or a closely related pseudocode.

solomonbyesterday at 6:07 PM

These fall directly out of ML.

LeCompteSftwareyesterday at 1:33 PM

Lean is definitely a dependently typed ML-family language like Agda and Idris, so "ML" has it covered. And the long-term goal of Lean certainly is not "execution is only secondary"; Microsoft is clearly interested in writing real software with it: https://lean-lang.org/functional_programming_in_lean/Program...

OTOH if you really want to emphasize "intended to express proofs" then surely Prolog has that covered, so Lean can be seen as half ML, half Prolog. From this view, the Curry-Howard correspondence is just an implementation detail about choosing a particular computational approach to logic.