Skip to content

Extend PureLang cexp with annotations #73

Open

Description

@hrutvik

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.

Activity

  1. added this to the Inlining extensions milestone on Feb 9, 2024
  2. hrutvik commented on Feb 29, 2024

    @hrutvik
    CollaboratorAuthor

    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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions