I really like something like the following, and I don’t remember why it doesn’t work/is suboptimal
Here is an earlier write-up of some problems I encountered experimenting with such an approach.
I feel like this is the Scala way of solving this
Can you phrase the benefits in terms of some objective criteria?
To me, generating potentially thousands of runtime forwarders in bytecode, and then relying on the JIT to remove them from the running application, seems a roundabout, bloated and inefficient way to achieve a goal of composing together some import expressions into a larger expression.
We have language-level constructs for composing data (case classes) and operations (methods/functions). There is a need to compose the shared-structure in import expressions into larger units. IMO it will be simpler and more efficient to do that in the language layer, than co-opting a runtime mechanism that was initially designed for a different purpose.