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

Feature/typed core draft #203

Merged
merged 49 commits into from
Dec 5, 2022
Merged

Feature/typed core draft #203

merged 49 commits into from
Dec 5, 2022

Conversation

b-studios
Copy link
Collaborator

@b-studios b-studios commented Dec 2, 2022

This is very much WIP. Baby steps towards a typed version of core.

TODO

  • properly substitute types for patterns in the match compiler.
  • fuse elaboration and transformer to avoid inconsistent intermediate states.
  • Maybe drop cargs again (since they are always bargs_i.capt).

@b-studios b-studios marked this pull request as ready for review December 4, 2022 19:29
@b-studios
Copy link
Collaborator Author

I think this PR is now ready for review. A review should mostly focus on the design (also wrt to how we can also port lifted at some point).

Symbols should be treated as opaque starting from core (in the future). Some backends still use symbol information instead of looking up the information in the declarations section of the core module.

@b-studios
Copy link
Collaborator Author

@marzipankaiser I added you as a reviewer since you are most affected by it, since you want to implement type-boxing/unboxing based on typed core.

@b-studios
Copy link
Collaborator Author

@fritzladwig this PR could also really help you, since the new representation might be easier to test. We could easily write a parser for this core representation. The parsed trees then could be used in your tests for optimization.

case Record(id: Symbol, fields: List[Symbol])
case Interface(id: Symbol, operations: List[Symbol])
case Data(id: Id, tparams: List[Id], constructors: List[Constructor])
case Record(id: Id, tparams: List[Id], constructor: Constructor)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider absorbing Record into Data (and likewise on the object language type level). Keep Select (it happens to work on all data types with a single constructor).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, let's do this. However, we should do this after this PR since we also need to push this change through lifted and I don't want to touch lifted too much in this PR.

@b-studios b-studios merged commit ee1d365 into master Dec 5, 2022
@b-studios b-studios deleted the feature/typed-core-draft branch December 5, 2022 11:36
@b-studios
Copy link
Collaborator Author

Thanks @phischu for the comments. We should address them in a separate PR

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

Successfully merging this pull request may close these issues.

None yet

2 participants