SF LEAN · ALOK SINGH · JULY 21, 2026
An ordinary programming language
with a reason not to become Python
records · functions · errors · Clifford algebra · a typed InfoView boundary
Not a big-bang rewrite. Existing Haskell still runs while its footprint shrinks.
A language is vulnerable when its distinctive value becomes
organizationally substitutable.
A continuum from executable model to machine-checked specification and proof.
JOB ONE
strict functional code
arrays, loops, IO, errors
native compilation and Lake libraries
JOB TWO
dependent types
propositions and proofs in the language
a small kernel checks the result
Lean is officially described as both a programming language and proof assistant · lean-lang.org
structure PlanarGrid where
xCount : Nat
yCount : Nat
def sampleCount (grid : PlanarGrid) : Except String Nat := do
if grid.xCount < 2 then
throw "xCount must be at least 2"
return grid.xCount * grid.yCount
#evalExcept.ok 9 sampleCount { xCount := 3, yCount := 3 }
Except.ok 9#evalExcept.error "xCount must be at least 2" sampleCount { xCount := 1, yCount := 3 }
Except.error "xCount must be at least 2"
This slide is a Lean file. Verso type-checked the code while building the deck.
record → function → Except → Array → typed scene props → JSON → SVG
Switch to Cursor · OrdinaryProgrammingDemo.lean
import
F_0(p)=v(p)+p\,v(p)+\tau(p)I
F_\theta(p)=R_\theta F_0(p)\operatorname{reverse}(R_\theta)
Haskell's strengths held up.
Lean's niche is not “nicer functional syntax.”
Lean is an ordinary language
whose second job is not ordinary.
program → test → specification → proof → editor tool<br> browser demo · presenter tutorial