A focused vision for Project Pterodactyl
After a few very enlightening conversations following my HoTTEST seminar talk “Is it time for a new proof assistant?”, I have realised that one of the more important aspects of my plans for Pterodactyl is its focused and restricted vision. I cannot promise that we will succeed, but I do think that by not trying to be all things to all people, we may be able to avoid some likely ways of biting the dust.
We are not building a general-purpose programming language
- September 27, 2025
- Jon Sterling
Any implementation of dependent type theory is a programming language of sorts, following the Curry–Howard correspondence, but I have come to believe that to build an actually good programming language (like OCaml, Lean, Rust, or Idris) is a very different task from building an actually good proof assistant (like Rocq, Lean, or Isabelle).
If you have enough resources, you can do both at the same time (like Lean). If you don’t have enough resources, I think you end up with something that is going to be inadequate as either a general-purpose programming language or as a proof assistant.
I do think that this is a point we could revisit in the future, but only after we have achieved our primary goals. Not having general-purpose programming as a primary goal doesn’t mean we can’t write programs in the language; I think that, instead, punting on things like “Being competitive with OCaml and Rust” means that there will be more space for ambitious dependent-type-native people to explore the possibilities of dependently typed programming without having to answer questions for which we don’t yet have good enough answers.
We have no plans to self-host, ever
- September 27, 2025
- Jon Sterling
When you build a language you really like, it is natural to want to rewrite its compiler in itself. This is a reasonable impulse, but I believe that it can also create inertia and painful coupling as you have to negotiate changes to the language with changes to the compiler in both directions rather than in only one direction.
Here’s the thing: if we were to write a highly-performance-constrained system (like a proof assistant) in itself, the proof assistant’s compiler and execution model would need to immediately be competitive with state-of-the-art programming languages with vastly more resources and expertise behind them. I do think that we can build something that is competitive with Agda, but I do not think we could build something that is competitive with both Agda and Rust or OCaml at the same time.
I believe that it is a good goal to have a system that can do both. But I think that in order to get there in a resource-constrained environment, it is very important that the goals be achievable separately. If we have to achieve both in order to achieve one, we will realistically achieve none.
We do not have plans for general-purpose metaprogramming
- September 27, 2025
- Jon Sterling
One of the most interesting things about Idris 1, Agda, and Lean is their approach to metaprogramming. In either system, you can hook directly into their elaboration monad and write metaprograms directly in the language, and then designate certain of these metaprograms as tactics or macros.
I think that this is an excellent model, but one of the reasons I am planning to shy away from it is that I believe it introduces a great deal of coupling between user-land code and the implementation details of the system (including its representation of syntax, its approach to elaboration and the suspension of elaboration problems, its approach to unification, etc.).
This is similar to the self-hosting problem; with enough resources, you can pat your head and rub your belly at the same time, but I believe that avoiding the coupling that metaprogramming introduces for the longest time possible will increase our probability of achieving our primary goals.
We do have plans for procedural reasoning
- September 27, 2025
- Jon Sterling
Some community members have expressed skepticism about what might be lost in reducing everything to a problem-oriented programming model like that of “The View From the Left”. For example, a large part of typical tactic scripts in Rocq amounts to procedurally generalising goals and calling eliminators, and this is indeed well-handled by the Mc Bride—McKinna model; on the other hand, there are many other useful pieces of tactical reasoning like apply f or eapply f that aren’t discussed in that paper. If we built a system in which you could not easily backchain through a lemma, it would indeed be a pretty unrewarding system to use.
The particular case of backchaining through lemmas can, however, be addressed within a very small extension of the Mc Bride–McKinna model. For this, we will need what might be referred to as the “view from the right”. There is an analogy to be had here:
- Mc Bride and McKinna defined a general notion of “elimination operator”, and devised a pattern matching notation for it.
- We seem to need to define a general notion of “introduction operator”, and then devise a co-pattern matching notation for it.
In Epigram, we can think of the ability to return a value (written ) as the beginning of a “view from the right”, which is just lacking any kind of right-handed decomposition. Our goal is to add this decomposition.
Consider the case of showing that a particular sum is a proposition, using a lemma about the closure of propositions under internal sums. Here is our initial proof state as it might appear in our editor:
Next, we use the backchaining introduction operator, which generalises the usual “return” / co-gadget of Epigram to allow for subgoals.
Note that with records, we can easily arrange for the subgoals of to have more human-readable names than , as we’ve done above. The first goal is easy to solve using another lemma; that lemma has no subgoals, so that branch is finished off like so:
In the second branch, we can abstract the variable.
Next, we backchain through yet another lemma, namely that propositions are sets.
Finally, we finish up the problem with a lemma that has no subgoals.
Personally, I find the above to strike a good balance between readability and writeability while maintaining the very important procedural aspect of how mathematicians write proofs; it is an extremely small generalisation of the Mc Bride–McKinna model.
We can workshop the notation and improve it, but I think the underlying idea here is viable. For those who think “But that is exactly what we already had with tactics”, that is actually my entire point: I don’t want to get rid of procedural tactical reasoning, but I do want to find a way to incorporate it into a problem-oriented notation that mostly documents itself in connection with editor facilities to see the proof state at a given step.
I won’t say that this solves all problems, but I hope it gives some impression of the methodology by which we will tackle procedural reasoning.
Stepping through proofs is important
- September 27, 2025
- Jon Sterling
It is important to be able to see what the goal was at a given point in a proof that has already been completed. If we return to our example of right-handed procedural reasoning:
We could instrument the language server to emit either tooltips or expandable inlays on each or that will display the goal that is being refined. For example, I plan to make it so that if you select the second in the above, the editor would display something like
Ideally, selecting the occurrences of the backchained lemmas on the right-hand side would lead to a display that reveals exactly how they have been specialised for the goal. For example, if you select the occurrence of the editor might display something like the following: