Skip to content

Rust Engine: add a Backend trait#1603

Merged
W95Psp merged 13 commits intomainfrom
rengine-backend-printer-traits
Aug 25, 2025
Merged

Rust Engine: add a Backend trait#1603
W95Psp merged 13 commits intomainfrom
rengine-backend-printer-traits

Conversation

@W95Psp
Copy link
Copy Markdown
Contributor

@W95Psp W95Psp commented Aug 19, 2025

Context

Before this PR, we had no proper notion of a backend, only a notion of what is a printer.
A backend is a printer + some transformation phases.

This PR

This PR introduces a Backend trait, and a Phase trait.
The Phase trait is mostly inert for now, it requires some more design. (especially regarding phase constraints)

This PR also changes slightly the Printer and PrettyAst traits, and adds a few helpers.

@W95Psp W95Psp marked this pull request as ready for review August 19, 2025 10:19
@W95Psp W95Psp requested a review from a team as a code owner August 19, 2025 10:19
@W95Psp W95Psp requested review from a team, clementblaudeau, franziskuskiefer and karthikbhargavan and removed request for a team and karthikbhargavan August 19, 2025 10:19
Copy link
Copy Markdown
Contributor

@clementblaudeau clementblaudeau left a comment

Choose a reason for hiding this comment

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

LGTM (with a few questions). It is a much needed distinction between a printer (Ast->Doc) and a backend (set of phases + printer), and should make it much easier to create new backends, possibly by borrowing existing printers

Copy link
Copy Markdown
Member

@franziskuskiefer franziskuskiefer left a comment

Choose a reason for hiding this comment

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

Generally lgtm. Just a couple nits.

And please add clippy to the CI. There are way too many warnings here that (are not from this PR).

@W95Psp
Copy link
Copy Markdown
Contributor Author

W95Psp commented Aug 21, 2025

Thanks for the review @franziskuskiefer, regarding clippy, I opened #1613

Copy link
Copy Markdown
Member

@franziskuskiefer franziskuskiefer left a comment

Choose a reason for hiding this comment

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

Let's address the public API question separately. Sounds like that needs some design first.

@W95Psp W95Psp added this pull request to the merge queue Aug 21, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 21, 2025
@W95Psp W95Psp added this pull request to the merge queue Aug 25, 2025
@W95Psp
Copy link
Copy Markdown
Contributor Author

W95Psp commented Aug 25, 2025

Putting this in merge queue again. GH runner got stuck, it seems like: https://github.com/cryspen/hax/actions/runs/17139918692/job/48624921344.

Merged via the queue into main with commit b750af2 Aug 25, 2025
17 checks passed
@W95Psp W95Psp deleted the rengine-backend-printer-traits branch August 25, 2025 08:11
@W95Psp W95Psp restored the rengine-backend-printer-traits branch January 15, 2026 15:21
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