Lean's unfair advantage

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

A Haskell story, accurately

7 yearsHaskell in Scarf production
held upreliability, types, performance
new API worknow goes into Python
the taxbuild time, ecosystem, agent feedback

Not a big-bang rewrite. Existing Haskell still runs while its footprint shrinks.

Avi Press, “After 7 years in production, Scarf has reluctantly moved away from Haskell,” July 10, 2026

My inference, not Scarf's

A language is vulnerable when its distinctive value becomes
organizationally substitutable.

So what does Lean offer that “Python + more tests” does not?

A continuum from executable model to machine-checked specification and proof.

One language, two jobs

JOB ONE

Build the program

strict functional code

arrays, loops, IO, errors

native compilation and Lake libraries

+

JOB TWO

State why it is right

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

The boring part is the point

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 #eval sampleCount { xCount := 3, yCount := 3 }
Except.ok 9
#eval 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.

LIVE — prove job one first

record → function → ExceptArray → typed scene props → JSON → SVG

3 × 3 → 4 × 3 success → explicit error 9 samples → 600 multivectors

Switch to Cursor · OrdinaryProgrammingDemo.lean

One program, three reusable boundaries

import

F_0(p)=v(p)+p\,v(p)+\tau(p)I

F_\theta(p)=R_\theta F_0(p)\operatorname{reverse}(R_\theta)

Lean owns positions, products, coefficients, 24 frames, validation
the view owns projection, glyph geometry, interaction, SVG

Not “Haskell bad”

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 · one-screen cue card