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

Expose CLI for egglog-experimental #510

Merged
merged 12 commits into from
Jan 16, 2025
Merged

Conversation

Alex-Fischman
Copy link
Collaborator

@Alex-Fischman Alex-Fischman commented Jan 7, 2025

This PR exposes the command-line interface so that the egglog-experimental crate can reuse it, as well as significantly improving the existing source code.

Copy link

codspeed-hq bot commented Jan 7, 2025

CodSpeed Performance Report

Merging #510 will not alter performance

Comparing Alex-Fischman:cli (6e05fe9) with main (df92e00)

Summary

✅ 10 untouched benchmarks

@Alex-Fischman Alex-Fischman requested review from oflatt and a team and removed request for a team January 7, 2025 18:35
@Alex-Fischman
Copy link
Collaborator Author

I would review this PR commit-by-commit, they are all pretty small and well separated, and the last one is code motion (necessary to expose the cli function to egglog-experimental).

@Alex-Fischman Alex-Fischman marked this pull request as ready for review January 7, 2025 19:14
@Alex-Fischman Alex-Fischman requested a review from a team as a code owner January 7, 2025 19:14
@Alex-Fischman Alex-Fischman removed the request for review from a team January 7, 2025 19:24
src/cli.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@yihozhang yihozhang left a comment

Choose a reason for hiding this comment

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

I have a small question and otherwise it looks good

@Alex-Fischman
Copy link
Collaborator Author

Alex-Fischman commented Jan 9, 2025

After talking to people offline I believe that the bin feature is adding unnecessary complexity, so I've removed it (and cleaned up Cargo.toml in the process). I will add it back if someone has a use case for it, but no one that I've talked to on the core team has one.

@yihozhang
Copy link
Collaborator

@DaniPopes we are thinking about simplifying our build dependencies and removing the feature flags that used to keep the build thin. Please take a look at this PR. Since you made #467, do you have any usage for having these feature flags?

@DaniPopes
Copy link
Contributor

DaniPopes commented Jan 10, 2025

Yes, it's for excluding clap, graphviz, chrono... dependencies that are unused when importing egglog as a library. This brings the total dependencies imported from 133 down to 56.

@Alex-Fischman
Copy link
Collaborator Author

@DaniPopes Do you have a use case where having fewer dependencies matters?

For context, the egglog team's current goal is to stabilize this crate by June, and it doesn't seem like having Cargo features is worth the smaller build to me. That said, if someone depends on this, we can support it as a library feature.

@Alex-Fischman
Copy link
Collaborator Author

I think the ping failed (I edited it in), my bad. @DaniPopes

@DaniPopes
Copy link
Contributor

Well it's not really a use case, but I would say it's pretty significant the fact that it's 3 times faster to build basically for free?

Having feature gates for the library, required to build the binary is a pretty common pattern for this reason; the features are enabled by default to allow "cargo install" to work without extra flags, and library users can opt-in to lower dependencies with default-features=false

@Alex-Fischman
Copy link
Collaborator Author

I've added back the features. I've cut the serde_json dependency as it is not used in the main crate.

Copy link
Collaborator

@yihozhang yihozhang left a comment

Choose a reason for hiding this comment

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

Thanks!!

@yihozhang yihozhang merged commit 6a3486e into egraphs-good:main Jan 16, 2025
5 checks passed
@Alex-Fischman Alex-Fischman deleted the cli branch January 16, 2025 20:58
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.

3 participants