
Ask HN: What's the best formal language? - miguelrochefort
I&#x27;m looking for the best formal language, where &quot;best&quot; implies elegance, simplicity and consistency.<p>It doesn&#x27;t have to be a programming language, although I&#x27;m expecting most candidates to be. Mathematics, RDF&#x2F;OWL and lojban are examples of non-programming languages that could be acceptable candidates.<p>One way to gauge how good a language is could be to compare how it solves some of the usual programming challenges such as Project Euler and TodoMVC against other languages.<p>For example, it seems like a logic programming language like Prolog would excel at Project Euler, while a FRP language&#x2F;framework like Elm would excel at TodoMVC.<p>Please note that I do not care at all about pragmatism. The language could exist without a compiler, be abandoned, have no community or third-party packages&#x2F;modules, take 1 year to execute Project Euler&#x27;s Problem 1, etc.<p>I&#x27;m more interested in the discussion and process than in finding what the actual &quot;best&quot; language is.
======
kazagistar
Consider Idris. [http://www.idris-lang.org/](http://www.idris-lang.org/)

\- It is an ML family language, with a compiler written in Haskell. This comes
with all the elegance and clean syntax of a modern typed functional language.

\- It uses a dependent type system, similar to Agda. This means that the types
can carry arbitrary proof information.

\- The infrastructure is built around this. There is a proof assistant to
assist you in building proofs that everything works.

\- Its not entirely unpragmatic, as it actually has a (small) community, and
can compile to C and then (somewhat) efficient code. But who cares about that,
right?

For a really cool example, see this video, where they implement a Semigroup
and Monoid instance for an Option type, including proofs that the appropriate
laws hold for the implementation:
[https://www.youtube.com/watch?v=P82dqVrS8ik](https://www.youtube.com/watch?v=P82dqVrS8ik)

------
alcuadrado
Most formal languages are created with an specific purpose, so there isn't
simply a "best" one. You normally use tons of them in academia, and many times
simultaneously.

If you give more information about what you are looking for, we may be able to
help you.

If you just want to learn something interesting though, I'd say typed lambda
calculus is a great option.

------
jackfoxy
The simply typed lambda calculus.

------
setra
The lambda calculus

~~~
blohard
Good suggestion. Also consider its programming language counterpart, Scheme.

~~~
miguelrochefort
Scheme is like untyped calculus.

What about typed calculus?

