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

chore: pass in file reader to FileManager at runtime #2649

Merged
merged 7 commits into from
Sep 29, 2023

Conversation

TomAFrench
Copy link
Member

Description

Problem*

Summary*

We currently conditionally compile how the FileManager reads in files based on the target architecture. If we were to pass this in as a boxed closure we could remove the need for noir-source-resolver entirely. wasm would then have full control on how to load Noir source.

This will add some overhead to reading in files however so I'd be interested to hear any opinions one way or the other. I'm preferring this solution to a generic to avoid that spreading and making the whole compiler generic.

cc @phated @kevaundray

Documentation

  • This PR requires documentation updates when merged.

    • I will submit a noir-lang/docs PR.
    • I will request for and support Dev Rel's help in documenting this PR.

Additional Context

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@kevaundray
Copy link
Contributor

This will add some overhead to reading in files however so I'd be interested to hear any opinions one way or the other.

What overhead are you referring to?

@TomAFrench
Copy link
Member Author

TomAFrench commented Sep 11, 2023

What overhead are you referring to?

Rather than just calling the function which is currently defined at compile-time, it'll need to go through the extra layer of dealing with the Box whenever we load a file.

@TomAFrench TomAFrench changed the base branch from master to tf/make-std-reading-arch-agnostic September 27, 2023 14:59
Base automatically changed from tf/make-std-reading-arch-agnostic to master September 27, 2023 16:36
* master:
  chore: remove leftover files from `acvm-repo` (#2861)
  chore: miscellaneous ACVM fixups (#2864)
  chore(noir): Release (master) (#2875)
  fix: Remove cast for field comparisons in brillig (#2874)
  fix: remove duplication of code to load stdlib files (#2868)
  chore(noir_js): remove unnecessary input validation in JS (#2841)
  chore: build yarn packages in parallel (#2867)
  chore(ci): remove `toml2json` dependency (#2862)
  chore: fix infinite loop in yarn workspace cleaning (#2863)
@TomAFrench TomAFrench marked this pull request as ready for review September 28, 2023 11:29
kevaundray
kevaundray previously approved these changes Sep 29, 2023
@kevaundray kevaundray added this pull request to the merge queue Sep 29, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Sep 29, 2023
@TomAFrench TomAFrench added this pull request to the merge queue Sep 29, 2023
Merged via the queue into master with commit 8d67997 Sep 29, 2023
24 checks passed
@TomAFrench TomAFrench deleted the tf/file-manager-closure branch September 29, 2023 22:10
TomAFrench added a commit that referenced this pull request Sep 29, 2023
* master:
  chore: pass in file reader to `FileManager` at runtime (#2649)
TomAFrench added a commit that referenced this pull request Sep 29, 2023
* master:
  chore: fix typescript linting errors (#2914)
  chore: pass in file reader to `FileManager` at runtime (#2649)
Sakapoi pushed a commit to Sakapoi/noir_fork that referenced this pull request Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants