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

Separate recursive solver #546

Merged
merged 7 commits into from
Jul 7, 2020

Conversation

zaharidichev
Copy link
Contributor

@zaharidichev zaharidichev commented Jun 30, 2020

This PR builds on top of the work that @jackh726 did in #542 and separates the recursive solver into its own crate that depends on chalk_solve. This is just a WIP to get a sanity check whether it is heading in the right direction.

One of the questions I have is whether we actually want to limit the API surface are of the recursive solver and chalk engine as much as possible or this is not a goal.

Namely, is saying that the only thing that the recursive solver crate needs to export is RecursiveSolverImpl ?

Copy link
Member

@jackh726 jackh726 left a comment

Choose a reason for hiding this comment

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

This looks great :)

A few comments. But otherwise, we should also make sure to update the book and double check that publishing chalk-recursive will be fine. And I would like at least a quick review/okay from another person, since I wrote the first commit. @nikomatsakis?

chalk-engine/Cargo.toml Outdated Show resolved Hide resolved
chalk-engine/src/solve.rs Outdated Show resolved Hide resolved
chalk-integration/Cargo.toml Outdated Show resolved Hide resolved
chalk-recursive/Cargo.toml Outdated Show resolved Hide resolved
chalk-recursive/src/recursive.rs Outdated Show resolved Hide resolved
chalk-recursive/src/recursive.rs Outdated Show resolved Hide resolved
chalk-solve/Cargo.toml Outdated Show resolved Hide resolved
chalk-solve/src/infer/normalize_deep.rs Outdated Show resolved Hide resolved
chalk-solve/src/solve.rs Outdated Show resolved Hide resolved
where
I: Interner,
S: Solver<I>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we possibly make this use a dyn trait? I think I'd prefer that to keep the generics under control.

Copy link
Contributor

Choose a reason for hiding this comment

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

But I'd be happy to consider all that as follow-up work

Copy link
Member

Choose a reason for hiding this comment

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

I'll file an issue for this.

pub enum SolverImpl {
Slg(SLGSolverImpl<ChalkIr>),
Recursive(RecursiveSolverImpl<ChalkIr>),
}
Copy link
Contributor

Choose a reason for hiding this comment

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

dyn trait?

@nikomatsakis
Copy link
Contributor

I'm good to merge when @jackh726 is

@zaharidichev zaharidichev force-pushed the zd/separate-rec-solver branch from 5cf6876 to b3233f2 Compare July 7, 2020 19:59
@zaharidichev zaharidichev changed the title [WIP] Separate recursive solver Separate recursive solver Jul 7, 2020
@zaharidichev zaharidichev requested a review from jackh726 July 7, 2020 20:00
jackh726 and others added 6 commits July 7, 2020 23:14
Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
@zaharidichev zaharidichev force-pushed the zd/separate-rec-solver branch from b3233f2 to a414412 Compare July 7, 2020 20:16
@zaharidichev
Copy link
Contributor Author

Oops seems like I need to move some tests around, hence the build failure

@jackh726
Copy link
Member

jackh726 commented Jul 7, 2020

@zaharidichev I fixed it :) Let me do one more quick review then I'll probably merge this.

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.

4 participants