Skip to content

Connect the Driver to the main compilation pipeline#289

Merged
KyrylR merged 3 commits intoBlockstreamResearch:dev/importsfrom
LesterEvSe:feature/modules-support
Apr 22, 2026
Merged

Connect the Driver to the main compilation pipeline#289
KyrylR merged 3 commits intoBlockstreamResearch:dev/importsfrom
LesterEvSe:feature/modules-support

Conversation

@LesterEvSe
Copy link
Copy Markdown
Collaborator

@LesterEvSe LesterEvSe commented Apr 21, 2026

This PR introduces the --dep flag to the compiler, enabling proper dependency resolution.

Added:

  • three new examples: single_dep, simple_multidep, multiple_deps
  • functional tests
  • error tests

@LesterEvSe LesterEvSe requested a review from KyrylR April 21, 2026 14:20
@LesterEvSe LesterEvSe self-assigned this Apr 21, 2026
@LesterEvSe LesterEvSe requested a review from delta1 as a code owner April 21, 2026 14:20
@LesterEvSe LesterEvSe added the enhancement New feature or request label Apr 21, 2026
@LesterEvSe LesterEvSe force-pushed the feature/modules-support branch 2 times, most recently from 4cc8a87 to 8076f65 Compare April 22, 2026 08:08
@LesterEvSe
Copy link
Copy Markdown
Collaborator Author

Some bugs with errors mention here: #290

@LesterEvSe LesterEvSe force-pushed the feature/modules-support branch from 01f0e12 to 8b12ac6 Compare April 22, 2026 12:27
Copy link
Copy Markdown
Collaborator

@KyrylR KyrylR 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

@KyrylR KyrylR merged commit 8b12ac6 into BlockstreamResearch:dev/imports Apr 22, 2026
11 checks passed
@KyrylR KyrylR mentioned this pull request Apr 22, 2026
6 tasks
delta1 added a commit that referenced this pull request Apr 23, 2026
8b12ac6 fix: internal error inside resolution.rs and add error tests (Sdoba16)
da1240a test: add functional tests (Sdoba16)
7df36e7 feat: add `--dep` flag and connect driver to overall execution flow, add examples (LesterEvSe)
857cc5a feat: change ast.rs to match the functionality of the driver (LesterEvSe)
fda737f fix: resolution data structure and alias architecture (LesterEvSe)
260d844 feat: add and test import aliases (LesterEvSe)
8300fe5 feat: add linearize and build functionality to the driver, fix `Error` enum a bit (LesterEvSe)
f5999f2 feat: Added linearization algorithm (Sdoba16)
056a359 feat: implement `DependencyGraph` inside `driver.rs` file and change parse trait to the `SourceFile` (LesterEvSe)
e2604f3 feat: add data structure for dependency resolution (LesterEvSe)
2064542 feat: add `SourceFile` to the `RichError` and change the `ErrorCollector` (LesterEvSe)
80ae099 feat: add import errors (LesterEvSe)
3c7d4c3 feat: implement resolution.rs utils (LesterEvSe)
7ddeed2 feat: add pub and use keywords and parse them (LesterEvSe)

Pull request description:

  ## 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

  - [x] **Visibility:** Added `pub` and `pub use` to control local scope versus re-exporting.
  - [x] **Import Syntax:** Implemented parsing and resolution for `use m::name;` and explicit aliasing (`as`).
  - [x] **Collision Handling:** Enforced strict errors for local scope collisions, utilizing linearization for resolving re-export conflicts.
  - [x] **Transitive Dependencies**: Add support for libraries importing other libraries.
  - [x] **Documentation:** Сode comments are updated accordingly.
  - [x] **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

ACKs for top commit:
  KyrylR:
    ACK 8b12ac6; code review and test runs (see #260, #256, #265, #266, #269, #278, #279, #280, #283, #287, #284, #289)
  delta1:
    ACK 8b12ac6; tested locally

Tree-SHA512: bec0d7437279dd45810cd8b13b48ba3921739d8c38f61d2f61401e419b32a2f4b31328df2c5596375fe8c69cabadc3e931a639ad833fe446918d1360091a447f
@LesterEvSe LesterEvSe deleted the feature/modules-support branch April 23, 2026 12:28
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.

3 participants