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

Extend PureLang cexp with annotations #73

Open
hrutvik opened this issue Feb 9, 2024 · 1 comment
Open

Extend PureLang cexp with annotations #73

hrutvik opened this issue Feb 9, 2024 · 1 comment

Comments

@hrutvik
Copy link
Collaborator

hrutvik commented Feb 9, 2024

Add an Annot form to cexp as follows:

annot = Inline mlstring | ...

cexp = ... | Annot annot cexp

This should desugar as follows: exp_of (Annot _ ce) = exp_of ce.

@hrutvik hrutvik added this to the Inlining extensions milestone Feb 9, 2024
@hrutvik
Copy link
Collaborator Author

hrutvik commented Feb 29, 2024

Discussion in meeting:

Annotation types: annot = NoInline | Inline | Inlineable | ConLike | InlineHere mlstring | ...

  • For top-level functions, expect annotations to be introduced on RHS, i.e. Let x (Annot Inline e1) e2. This means that annotations appear around lambdas, so the inliner needs to ensure it looks under Annot when considering arities.
  • Pragmas to support
    • Top-level pragmas mirroring GHC: {-# INLINEABLE f #-}, {-# INLINE f #-}, {-# NOINLINE f #-}, {-# CONLIKE #-}
    • Special function for inlining at a specific call-site: #(__inline), akin to GHC's inline
    • {-# INLINE_IN_SCOPE f #-} (or similar): a variant of #(__inline) which applies to the current scope, i.e. wrap the entire scope in an InlineHere <name> expression

hrutvik added a commit that referenced this issue Mar 6, 2024
hrutvik added a commit that referenced this issue Mar 6, 2024
hrutvik added a commit that referenced this issue Mar 7, 2024
Progress towards #73
hrutvik added a commit that referenced this issue Mar 7, 2024
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