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

Refactor using backend trait #35

Closed
wants to merge 10 commits into from
Closed

Conversation

katat
Copy link
Collaborator

@katat katat commented Apr 13, 2024

Updated backend trait refactor PR based on the review comments from the previous PR.

For any backend related implementations, they are moved to the folder backends/kimchi/, such as the builtin, asm, prover.

For the comment: #30 (comment)

  • The Arc is somehow needed when it needs to clone the FnHandle in generic form.
  • I tried to revert it to use Box in this branch, it throws cannot borrow *self as mutable because it is also borrowed as immutable in the compute_expr function.
  • I think this issue originates from this ineffective clone after the backend trait is introduced. But to get the backend trait cloneable, it seems requiring the Arc.

Copy link
Contributor

@mimoo mimoo left a comment

Choose a reason for hiding this comment

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

Just some preliminary comment: it's easier for the reviewer for large PRs like this one to chunk it into smaller commits where we can clearly see code being moved around.

I think a simple git mv should be used in a commit if possible (before another commit that changes that code, for example), or it should be clear in each commit what code was removed from a file and added in another.

Also the addition of the type parameter Backend or Field everywhere could be a commit of its own also. It doesn't matter to me if a commit doesn't build, but at least it's easier to review commits within a PR.

I know it's annoying to do these changes though, so I propose that you don't and that I just take the time to go through this PR file by file. Will take me some time this week tho! And the next large PR please cut it down nicely for the reviewer :D

@@ -0,0 +1,188 @@
//! ASM-like language:
Copy link
Contributor

Choose a reason for hiding this comment

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

do you know how I can see the diff of asm.rs here? It would have been good to see a mv commit first and then a commit changing it :o not sure if there's a command I can run now to see a diff

@@ -0,0 +1,183 @@
use std::sync::Arc;
Copy link
Contributor

Choose a reason for hiding this comment

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

the same is true here, I think for these kind of changes it's easier if I see commit that move things around properly :o

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@katat
Copy link
Collaborator Author

katat commented Apr 16, 2024

close this one for #36

@katat katat closed this Apr 16, 2024
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