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

Proper label scoping in macro #81

Open
lightclient opened this issue Sep 26, 2021 · 0 comments
Open

Proper label scoping in macro #81

lightclient opened this issue Sep 26, 2021 · 0 comments
Labels
A-assembler Area: assembler C-enhance Category: a request for an improvement E-medium Experience: of moderate difficulty

Comments

@lightclient
Copy link
Contributor

In #69 we added a random postfix to label names to create a scope. It would be nice to have better guarantees about the scope and not rely on the small possibility of label collisions.

A few ideas we had:

  • Expand the capabilities of Ingest to support expanding macros. This is not trivial because the Independent scope is truly independent and needs no external data to fully assemble its ops. This is not the same assumption that instruction macros make, because they can use labels from the outer scope and when concretized they need to have an understanding of where they've been invoked in terms of concrete ops.
  • Use a sub-assembler, like with the push macro. Unfortunately it likely falls victim of the same issues as above.
  • Create a new Scope enum in the assembler module and expand the Label type to be a name and scope. This seems messy and it's annoying to have another Scope type.
@lightclient lightclient added A-assembler Area: assembler C-enhance Category: a request for an improvement E-medium Experience: of moderate difficulty labels Sep 26, 2021
@lightclient lightclient mentioned this issue Sep 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-assembler Area: assembler C-enhance Category: a request for an improvement E-medium Experience: of moderate difficulty
Projects
None yet
Development

No branches or pull requests

1 participant