Coq typeclass resolution is Turing-complete
thaliaarchi.github.io
thaliaarchi.github.io
The largest barrier to greater adoption of languages like Coq with proof systems built-in is the formal background needed to get started. I think that Rust has done an excellent job at making stronger systems more accessible, but it takes a lot of conscious work.
With JavaScript, I think the idea that performance in language design can be an afterthought, made up for by world-class optimizing JIT compilers, is fundamentally wrong. It doesn't give users a meaningful way to easily reason about the performance of the programs they write. The main implementation of Python, pythonc, is essentially an interpreter over an unoptimized bytecode format, giving it poor performance. I think performance considerations should be a fundamental part of the language design.
I'm wondering how this squares with the tendency of formal language theory folks to push for functional languages. It's clearly a preferred approach if rigorous correctness is your main goal, but don't functional languages like Haskell suffer from the fundamental issue that reasoning about runtime performance is really hard?
I believe this to be a language problem and not a conceptual problem. All that you need to pragmatically formalize semantics is Hoare triples and basic predicate calculus[1]. Anyone that can understand an if statement already has the necessary conceptual machinery. The so-called “formal methods” community delights in over complicating the problem with gadgets like category theory. Which is ironic, because they’re introducing the same kind of unnecessary complexity that causes the problem that they’re trying to solve.
[1] ok that’s not utterly strictly true because arrays (or mutable functions, as I like to think of them) present some subtleties, but those are more a problem for the definers rather than the users.
I’m excited to dig through this more. Nice work!
From the analysis[1] in the contest:
> {loader.c}, diagonalizes over the Huet-Coquand `calculus of constructions'. This is a highly polymorphic lambda calculus such that every well-formed term in the calculus is strongly normalizing; or, to put it another way, a relatively powerful programming language which has the property that every well-formed program in the language terminates. The program's main function is called D. … D works approximately as follows: given an argument x, it iterates over all bit strings with binary value less than or equal to x, and, if such a bit string codes for a well-formed program (`term' in lambda-calculus language), it runs the program (`strongly normalizes the term' in lambda-calculus language.) The return value of D is then obtained by packaging together the return values of all these programs. The program's return value is D@@5(99).
I hope by the time I retire proof tools are the norm. It’s heading in that direction, seems to me. When I started my career static vs dynamic was a big deal and here we are with typescript being mainstream. I do a lot of work in Rust and what that compiler can prove about lifetimes is still sometimes a surprise, compared to what I used to just have to muddle through over in my mind.
Maybe not a popular answer, but I think the answer to this is grad school. Someone gets a PhD in an area like this (e.g., building either theorem provers or their related infrastructure), then gets a job in the same or an adjacent area after graduation.
That's not the only way to do it, but looking around in my area of research (compilers and programming languages for HPC) there are definitely many more people who do it this way than just figure it out on their own.
Definitely some uncool ones out there, but Haskelldom is large so you can definitely find a place that at least allows for advanced type stuff but is still normal software dev. That may scratch that Coq itch.
And also for Rust traits, C++ templates, etc (those are all nonterminating)