Open andrevidela opened 3 years ago
We could use an optimised representation for Nat
s and Fin
s internally, cashing in on the fact that their constructors have at most 1 argument, and so an open natural number is of the form S^n t
with t
a non-canonical open natural number, and similarly for Fin
.
It would require a bespoke treatment of Nat
s and Fin
s. I'm guessing it would make the type-checker hairier.
I think there's a general thing we could do, allowing the users to view data structures as more efficient runtime and compile time implementations, but we'll need to make several research breakthroughs in generic metaprogramming first.
Recently I've started playing with proofs using large
nat
s andFin
s. While the programs outputed are fast thanks to the optimisation ofNat
toint
, the compiling time is very long even for very simple programs.This is not a proposal but a question: What are the ways we can improve the time of compilation when evaluating terms that we know optimise into a more efficient runtime representation?
I know that some flavours of lisp allow to update the definition of a function at runtime. Would it be possible to do the same for
Nat
and+
when type-checking on scheme?There are reports of similar issues but no plan in order to reach a resolution, see #16 and #1182