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

Compilation of TypeClassLang #64

Open
hrutvik opened this issue Sep 26, 2023 · 0 comments
Open

Compilation of TypeClassLang #64

hrutvik opened this issue Sep 26, 2023 · 0 comments
Milestone

Comments

@hrutvik
Copy link
Collaborator

hrutvik commented Sep 26, 2023

Compilation of TypeClassLang uses dictionary construction (actually, tuple construction) on fully-annotated TypeClassLang programs to produce PureLang programs. This must be proved sound with respect to TypeClassLang semantics, which is defined via naive translation to PureLang. However, compilation should be much more intelligent. For example:

  • declaring instances once and for all, rather than repeatedly constructing dictionaries (i.e. common subexpression elimination)
  • inlining methods where possible to avoid constructing a full dictionary/tuple
  • selectively monomorphising functions, bypassing dictionaries altogether
  • partially applying dictionaries for derived instances
  • and so on
@hrutvik hrutvik added this to the Type classes milestone Sep 26, 2023
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

No branches or pull requests

1 participant