Skip to content

Add imports functionality#264

Merged
delta1 merged 14 commits intomasterfrom
dev/imports
Apr 23, 2026
Merged

Add imports functionality#264
delta1 merged 14 commits intomasterfrom
dev/imports

Conversation

@KyrylR
Copy link
Copy Markdown
Collaborator

@KyrylR KyrylR commented Apr 1, 2026

Motivation (copied from #258)

The main goal of this PR is to enable an analogue of the OpenZeppelin library to exist in the SimplicityHL ecosystem. By introducing official compiler support for imports, we significantly increase code reusability and speed up application development. For projects heavily focused on security, this also allows developers to eventually "flatten" the code and audit all functions without external dependencies.

Checklist

  • Visibility: Added pub and pub use to control local scope versus re-exporting.
  • Import Syntax: Implemented parsing and resolution for use m::name; and explicit aliasing (as).
  • Collision Handling: Enforced strict errors for local scope collisions, utilizing linearization for resolving re-export conflicts.
  • Transitive Dependencies: Add support for libraries importing other libraries.
  • Documentation: Сode comments are updated accordingly.
  • Quality Assurance: Code is formatted, all tests pass, and CI shows no errors.

Related PRs (in order of the merge): #260, #256, #265, #266, #269, #278, #279, #280, #283, #287, #284, #289

@KyrylR KyrylR changed the title feat: add pub and use keywords and parse them Add imports functionality Apr 1, 2026
@KyrylR
Copy link
Copy Markdown
Collaborator Author

KyrylR commented Apr 1, 2026

Reopened instead of #258

@LesterEvSe LesterEvSe self-assigned this Apr 1, 2026
@LesterEvSe LesterEvSe added the enhancement New feature or request label Apr 1, 2026
@apoelstra
Copy link
Copy Markdown
Contributor

026c0ff needs rebase

@LesterEvSe
Copy link
Copy Markdown
Collaborator

Note for reviewers: This PR does not follow a strictly additive structure. It is composed of several smaller PRs, each of which has a linear change history on its own. However, when combined, some things introduced in an earlier sub-PR are intentionally removed or superseded in a later one as the design evolves.

For example, #265 adds PathBuf to several variants in the enum Error, but #280 removes them due to the current error handler architecture.

@KyrylR KyrylR marked this pull request as ready for review April 22, 2026 13:42
@KyrylR KyrylR requested a review from delta1 as a code owner April 22, 2026 13:42
@KyrylR
Copy link
Copy Markdown
Collaborator Author

KyrylR commented Apr 23, 2026

ACK 8b12ac6; code review and test runs (see #260, #256, #265, #266, #269, #278, #279, #280, #283, #287, #284, #289)

Copy link
Copy Markdown
Collaborator

@delta1 delta1 left a comment

Choose a reason for hiding this comment

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

ACK 8b12ac6; tested locally

@delta1 delta1 merged commit fa84636 into master Apr 23, 2026
22 checks passed
@LesterEvSe LesterEvSe linked an issue Apr 23, 2026 that may be closed by this pull request
@apoelstra apoelstra deleted the dev/imports branch April 23, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add imports with namespacing, pub/use, and C3 linearization

5 participants