Why the benchmarks of Bend's 2 typechecker are misleading (and possible problems with its type system)
The creators of Bend 2 claim that their typechecker:
outperforms every proof assistant by several OOMs
Bend's compiler is so powerful it can verify mathematical proofs. Usually, this is slow. Bend is not. It checks, in under a second, files that other projects would take minutes, making proofs way more practical.
It supposedly checks 12,800 definitions in 0.29 seconds, whereas Lean 4, Agda, Rocq/Coq, and Isabelle take tens of seconds or minutes.
To be honest, I'm no expert on how to compute λ-calculus in the fastest way possible, nor do I know anything about interaction nets, so I won't make any judgements about the runtime of this language. However, from a general perspective on how theorem provers are typically implemented and on type theory, claims by Taelin and co. raise many questions.
Perhaps there are some performance benefits from the typechecker's implementation, but the main reason Bend 2's typechecker is fast is simply that it doesn't do the work that modern proof assistants are designed to do.
The reported 0.29 seconds in Bend — versus tens of seconds and minutes in Lean, Agda, and Rocq/Coq — is a comparison of completely different processes. Let's have look at the source code for the synthetic benchmark bench/checker/generics_3200/main.agda with its Bend counterpart.
Here is Agda:
ubx (ubx (ubx (ubx (ubx (b))))) -- also, what's the point of these ( ) parentheses around the b?And here's what the equivalent code looks like in Bend:
ubx(K23, ubx(Bx<K23>, ubx(Bx<Bx<K23>>, ubx(Bx<Bx<Bx<K23>>>, ubx(Bx<Bx<Bx<Bx<K23>>>>, b)))))
Notice the difference? Interactive proof assistants (Lean 4, Agda, Rocq/Coq) spend a significant fraction of time not on trivial verification, but on elaboration and unification. Metavariables are inserted for all implicit types and arguments omitted by the programmer, and proof assistant runs complex unification algorithms to reconstruct the complete proof. If the language has type classes or instance arguments, the typechecker must look them up in context. I'm not even talking about tactics or complex metaprogramming systems like Lean's.
Bend has none of these: no unification, no implicit arguments and no type classes. Its typechecker is a lightweight one, that verifies the code in which everything has already been specified by the programmer (or an LLM).
The architecture of the most mature proof assistants (OK, maybe Agda isn't that mature after all…) is based on de Bruijn's criterion: a complex, "smart" frontend, which handles elaboration and then passes a fully explicit term to a tiny, verified, trusted kernel (capable of independently checking proofs produced by the proof assistant). For Lean (and Rocq/Coq), there are some independent external verifiers. Their sole task is to swiftly verify a fully elaborated term. If you feed a prepared term to the Lean core or one of these verifiers, it will verify it pretty fast. The authors of Bend essentially took someone else's multi-stage typechecker with powerful mechanisms and compared it their own simpler one.
You might ask: why complicate the typechecker with heavy unification algorithms when the code will be generated by an LLM in our post-AGI/RSI/etc era anyway? Why not let the model output a fully annotated AST right away?
From both engineering and economic standpoints, this is an extremely questionable compromise. Unification algorithms (particularly Miller's pattern unification) are expected to operate deterministically. If the equations cannot be solved unambiguously, the unification algorithm either applies heuristics or returns an error. A typechecker performs unification in microseconds and free of charge. Replacing a deterministic algorithm with a linguistic model means a developer saves 100 milliseconds of CPU time, but has to wait 10-20 seconds for a response from the LLM. And yeah, you will also spend money on tokens for this! Isn't that ridiculous?
Furthermore, using fully explicit syntax increases the size of the AST. By forcing the model to generate large trees with all types specified explicitly, you're wasting tokens. And long context causes "context rot", reducing the accuracy of LLM reasoning in cases where a typechecker with unification would guarantee full accuracy and correctness.
Comparing Bend's speed to that of Lean, Rocq, Agda, or Isabelle is pointless even from a purely mathematical standpoint: these are fundamentally different type theories that are simply not equivalent to one another.
Lean and Rocq/Coq operate within the calculus of inductive constructions (CIC) and Isabelle within higher-order logic (HOL).
BendTT is completely different, based on affine dependently typed theory for speed and performance reasons. Presumably, it could also prevent paradoxes. This imposes some strict restrictions: duplicating live functional closures at runtime is prohibited.
I mean, this is not a competition to optimize the implementation of the typechecker for the same type theory. I'm also not claiming that Bend's type theory is logically weaker (that still needs to be investigated), it's just that we're talking about completely different formalisms.
You cannot directly compare the verification times of systems with fundamentally different mathematical foundations and such incomparable capabilities.
The very idea behind the Bend's type system is built on an extremely dangerous foundation. In the comments for the bend.ts code, the author (or LLM operated by author?) openly state that their theory allows
This is actually where the history of dependent types began. The first version of Martin-Löf's type theory from 1971 included precisely the rule
The combination of
The authors of Bend claim to have circumvented this problem using affinity: since live variables cannot be used more than once, an infinite loop gets stuck exclusively in the "erased" type layer and cannot leak into runtime. There is even a formal proof of consistency in Lean in the repository (bend2/bend.lean, theorem consistency_holds).
However, there is a significant difference between formalisation on paper and a functioning system. The mere existence of a file in Lean only proves that the abstract model is consistent — a model that still needs to be studied and verified independently by the scientific community. At the same time, the actual checker is written in TypeScript (bend.ts), and the README explicitly states that there are differences between the code and the Lean model.