-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to an explicitly typed core language #417
base: main
Are you sure you want to change the base?
Conversation
@@ -1,4 +1,4 @@ | |||
stdout = ''' | |||
fun A a => a : fun (A : Type) -> A -> A | |||
fun (A : Type) (a : a) => a : fun (A : Type) -> A -> A |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a scoping error has been introduced somewhere?
Should be fun (A : Type) (a : A) => a : fun (A : Type) -> A -> A
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooooh yes you are right. wouldn't it be great if there was a way to ensure these were well scoped… 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be to do with when the function parameter types are quoted but I'll have a look
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was actually an issue in the distiller, which would have been a bit trickier to catch, alas. Perhaps with some sort of roundtrip test maybe.
fd53851
to
de9ccea
Compare
Should be fixed by #462? I'd like to see this merged |
Hmm, not sure. I think most of the bloat added here is from terms that do not come from user code originally. Because they have been quoted from values, they would need something like glued evaluation to keep them small. Does having explicit type annotations help you in something you are looking at? Should we try to get this merged? |
No, I just wanted symmetry with the type annotations in |
de9ccea
to
88c7337
Compare
88c7337
to
cff2b4c
Compare
This switches the core language to be explicitly typed, which might make compilation easier down the line, for example when figuring out if we need to compile to a term or a type. I remember this was tricky on my last time trying to implementing compilation/extraction, but I’d like to do some more experiments to see if this is actually the case, however, but this at least demonstrates the idea.
The resulting terms are a bit larger than I’d like, because we need to quote type annotations back to terms during elaboration. Glued evaluation potentially help here.
Closes #270