Skip to content
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

Add a "Core" intermediate representation #8

Closed
brendanzab opened this issue Sep 26, 2017 · 4 comments
Closed

Add a "Core" intermediate representation #8

brendanzab opened this issue Sep 26, 2017 · 4 comments

Comments

@brendanzab
Copy link
Member

At the moment our concrete syntax is highly coupled to the syntax we use for type checking and our proofs. It might make sense to separate these to allow for cleaner proofs and type checking, and allow us to add new features without altering the core language too much.

For example, PADS/ML has DDC:

screen shot 2017-09-26 at 12 02 00 pm

screen shot 2017-09-26 at 12 02 06 pm

The tricky thing is doing this in such a way that preserves good error messages (see #2).

@mikeday
Copy link
Contributor

mikeday commented Sep 26, 2017

It's inevitable that we will want to add some helpful syntax that gets desugared in the core representation.

@brendanzab
Copy link
Member Author

brendanzab commented Sep 27, 2017

One idea to get around the error reporting problem is to do what GHC does: implement a type checker+inference on the complex AST and a simple, more elegant type checker on the fully explicit core representation as a sanity check for debugging purposes.

@brendanzab
Copy link
Member Author

Could be as close to a direct port of the typechecker in the formal specification, perhaps, seeing as that would have progress, preservation, and soundness already verified:

https://github.com/yeslogic/ddl/blob/06ffee90a00b119a145babd1f9339fcd960f519c/experiments/lean/ddl.lean#L275-L296

In the future we could also have specifications of how the high level code is 'lowered' into the desugared representation.

@mikeday
Copy link
Contributor

mikeday commented Sep 27, 2017

Fun!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants