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

Draft: consider importing submodules into namespace using glob imports #6847

Closed

Conversation

amiremohamadi
Copy link
Contributor

Description

Fix #6843

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@amiremohamadi amiremohamadi requested a review from a team as a code owner January 21, 2025 19:11
@amiremohamadi amiremohamadi marked this pull request as draft January 21, 2025 19:12
@amiremohamadi
Copy link
Contributor Author

i'm still testing the edge cases but feel free to do a review!
cc: @ironcev

Copy link
Contributor

@jjcnn jjcnn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution, but I think this approach needs to be rethought.

I have just spent a long time trying to eliminate unnecessary cloning of modules, so I would very much appreciate of you could limit cloning of modules to an absolute minimum.

In particular, please don't clone an entire module including all its submodules when only the public submodules are visible.

More importantly, it would be much more beneficial if you could avoid cloning modules altogether and use references instead.

This is not an easy task to solve - it requires some fairly deep design considerations, both wrt. semantics and wrt. avoiding performance degredation.

@jjcnn
Copy link
Contributor

jjcnn commented Jan 23, 2025

@amiremohamadi : I have just added a corner case to #6843 that shows why we will need a complete rewrite of how we represent submodules in order to solve this issue.

@amiremohamadi
Copy link
Contributor Author

Ah right. It makes sense

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

Successfully merging this pull request may close these issues.

Consider importing submodules into namespace when using glob imports
2 participants