<p>I discuss dependent types, which are types that can contain non-type
programs. An example of a dependent type is a list whose type contains
its length. Instead of just writing <code>List&lt;String&gt;</code> for
a list that contains strings, dependent types include types like
<code>List&lt;String, 5&gt;</code> that describe lists of exactly five
strings. Dependent types can also be used to represent mathematics, in
which case the programs that they describe count as proofs, and tools
from programming can be used to write math.</p>
<p>Dependent types used to be something that really required a research
background, but there has been a lot of progress on making them more
user-friendly and on writing accessible introductions lately.</p>
<p>Languages mentioned:</p>
<ul>
<li><a href="https://www.idris-lang.org/">Idris</a> is a self-hosted
dependently typed language with type-level resource tracking</li>
<li><a href="https://wiki.portal.chalmers.se/agda/pmwiki.php">Agda</a>
is a testbed for new ideas in dependently typed programming</li>
<li><a href="https://leanprover.github.io/">Lean 4</a> is a self-hosted
dependently typed language that has a more conservative logical core
than Idris or Agda, and attempts to appeal more to practicing
mathematicians.</li>
<li><a href="https://coq.inria.fr/">Coq</a> is a proof assistant based
on dependent types that has been used to fully mathematically verify a C
compiler</li>
</ul>
<p>Books mentioned:</p>
<ul>
<li><a href="https://thelittletyper.com/">The Little Typer</a>, by
Daniel P. Friedman and David Thrane Christiansen is an intro to the core
ideas of dependent types, in dialog form</li>
<li><a
href="https://www.manning.com/books/type-driven-development-with-idris">Type
Driven Development with Idris</a> by Edwin Brady, the creator of Idris,
describes an approach to programming that uses expressive types as a way
to make programmers' lives easier</li>
<li><a href="https://plfa.github.io/">Programming Language Foundations
in Agda</a> by Phil Wadler, Wen Kokke, and Jeremy Siek describes the use
of Agda for both programming and proving</li>
<li><a href="https://softwarefoundations.cis.upenn.edu/">Software
Foundations</a> is a series of books that use Coq as an introduction to
mathematically rigorous software development in a proof assistant. It's
how I initially learned these topics!</li>
</ul>
