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

feat: add support for nested modules #992

Merged
merged 2 commits into from
Jul 22, 2023
Merged

feat: add support for nested modules #992

merged 2 commits into from
Jul 22, 2023

Conversation

tohrnii
Copy link
Contributor

@tohrnii tohrnii commented Jul 4, 2023

Describe your changes

Addressing #983

Checklist before requesting a review

  • Repo forked and branch created from next according to naming convention.
  • Commit messages and codestyle follow conventions.
  • Relevant issues are linked in the PR description.
  • Tests added for new functionality.
  • Documentation/comments updated according to changes.

@tohrnii tohrnii force-pushed the tohrnii-nested-modules branch 3 times, most recently from cf7cfc9 to 637e1ea Compare July 5, 2023 11:44
@tohrnii tohrnii force-pushed the tohrnii-nested-modules branch 11 times, most recently from 352d426 to 4441f27 Compare July 21, 2023 02:26
@tohrnii tohrnii requested a review from bobbinth July 21, 2023 02:31
@tohrnii tohrnii marked this pull request as ready for review July 21, 2023 02:31
@tohrnii tohrnii removed the request for review from bobbinth July 21, 2023 07:16
@tohrnii tohrnii marked this pull request as draft July 21, 2023 07:16
Copy link
Contributor

@bobbinth bobbinth 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! Looks good! I left some comments inline. Basically, I'm thinking we can change the approach so that all path manipulations are done at the time when we build libraries and everything else works as is. Basically, as we traverse directory tree, if we see something like x/y/mod.masm we transform this into library path x::y.

We should also probably add a check to the library construction logic to make sure that we get an error if there a file with the same name as the directory. For example:

/x/y/mod.masm
/x/y.masm

The above should fail because having y.masm conflicts with y/mod.masm.

assembly/src/library/path.rs Outdated Show resolved Hide resolved
assembly/src/library/path.rs Outdated Show resolved Hide resolved
assembly/src/procedures/mod.rs Outdated Show resolved Hide resolved
assembly/src/library/path.rs Show resolved Hide resolved
@tohrnii tohrnii marked this pull request as ready for review July 22, 2023 03:16
@tohrnii tohrnii requested a review from bobbinth July 22, 2023 03:17
Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you! I left a couple of small comments inline.

One thing I'm wondering is whether there is a good way to test this somehow. Maybe we could add some useful function under std::math or something like that?

assembly/src/library/path.rs Outdated Show resolved Hide resolved
assembly/src/library/path.rs Outdated Show resolved Hide resolved
@tohrnii
Copy link
Contributor Author

tohrnii commented Jul 22, 2023

One thing I'm wondering is whether there is a good way to test this somehow. Maybe we could add some useful function under std::math or something like that?

One option is to re-export methods of the fri or ecdsa module from mod.masm?

@bobbinth
Copy link
Contributor

One option is to re-export methods of the fri or ecdsa module from mod.masm?

Good idea! Let's do this: re-export std::crypto::stark::verifier::verify from std::crypto::stark.

@tohrnii
Copy link
Contributor Author

tohrnii commented Jul 22, 2023

One other question is if we should add a build step to copy the docs from stdlib crate to docs crate so that they are in sync.

@bobbinth
Copy link
Contributor

One other question is if we should add a build step to copy the docs from stdlib crate to docs crate so that they are in sync.

No, the formatting on auto-generated docs needs to be improved quite a bit.

Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

All looks good! Thank you!

@bobbinth bobbinth merged commit 7588767 into next Jul 22, 2023
15 checks passed
@bobbinth bobbinth deleted the tohrnii-nested-modules branch July 22, 2023 08:34
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