Making the IR more composable by allowing local references in addition to fully qualified ones #220
AttilaMihaly
started this conversation in
Ideas
Replies: 1 comment 4 replies
-
I like the idea. Are we talking about Do you mind including an example on how it would manifest itself in the |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Multiple community members brought up the wish to handle smaller portions of the IR as independent units instead of always working with an entire distribution. While the IR is very composable and you can independently define individual types or functions one specific design choice makes that less feasible:
To give a specific example when you are defining something like this:
The Morpir IR representation of this will look more like:
This means that if you are processing just this module and you get to
Bar
you need to know about the package name to understand thatMyPackage.MyModule.Foo
refers to the other type in the same module.While this was a conscious design decision to avoid downstream consumers having to do name resolution, it is also limiting the composability of the IR.
We could change this by allowing references to be more local by defining something like this:
Beta Was this translation helpful? Give feedback.
All reactions