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

Propagate procedure attributes from AST to MastForest #1517

Open
bobbinth opened this issue Sep 28, 2024 · 0 comments
Open

Propagate procedure attributes from AST to MastForest #1517

bobbinth opened this issue Sep 28, 2024 · 0 comments
Labels
assembly Related to Miden assembly

Comments

@bobbinth
Copy link
Contributor

With #1510 we have added procedure annotations to the assembler. These now get parsed and added to the AST. The next step is to process them and propagate the relevant attributes to the MastForest. But there are a few open questions around how this information should be handled that I think we'll want to pin down:

  • The whole "can we support annotating re-exported procedures" question. I think an easy "yes" can be given for some annotations. For example, if we add support for lints/deprecations, and wanted to mark a re-export as @deprecated("0.2.0", "use bar instead"), that's fine, as the re-export being deprecated when the original definition is not has value; similarly, they could both be marked deprecated differently, and resolving that conflict is obvious, as the one closest to the call site takes precedence. It's a completely different situation for annotations that aren't just "soft" metadata though, and may imply something about the behavior of the callee, or worse, change the behavior of either the callee or the caller. Propagating attributes in such a way that we can "do the right thing" at a call site for a given procedure can be a non-trivial question, if every re-export can potentially add new annotations that may override/conflict with those of the actual definition. We don't necessarily need to answer these questions now, but the answer will affect how we propagate this information in the assembler.
  • We probably should reserve some annotations that we're likely to need, and raise diagnostics if they are used (until we actually implement handling for them). For example, I'd probably reserve right out of the gate: warn, allow, forbid, deprecated, error, warning, test, derive, inline, type, doc, storage, feature, cfg, global, const, constant, dynamic, and whatever else is vaguely keyword like, or that we already anticipate using in the future or think we might want to use in the future.
  • We might want to flag the annotations we need with the highest priority, ideally with different categories of semantics, and look at how we'd support those, and use that process to make sure whatever implementation we come up with for propagating annotation information is solid enough to support all of them without too many contortions.

Originally posted by @bitwalker in #1434 (comment)

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

No branches or pull requests

1 participant