Skip to content

Conversation

@clementblaudeau
Copy link
Contributor

@clementblaudeau clementblaudeau commented Aug 19, 2025

This PR is based on #1603.
It updates the Lean backend to the new printing infrastructure.

Context

#1603 and #1600 added new infrastructure for printing, based on the return of experience of the Lean printer. Specifically, they introduced a proper notion of backend/printer, and some utils for writing docs.

This PR

This PR updates the Lean backend to the new infrastructure, which unfortunately makes for a monolithic swap. It should not make any semantic changes, besides whitespace and two library edits :

  • integer types are no longer defined as an indirection : usize is now Usize, u8 is now UInt8, etc
  • for clarity, rust arrays and vectors are now defined as an indirection abbrev RustVector := Array. The fact that Lean and Rust have opposite terminology was a source of confusion

@clementblaudeau
Copy link
Contributor Author

If the monolithic change is too hard to review, I can try to break it down into smaller pieces, but it's a non negligible amount of work.

@clementblaudeau clementblaudeau marked this pull request as ready for review August 20, 2025 09:48
@clementblaudeau clementblaudeau requested a review from a team as a code owner August 20, 2025 09:48
@clementblaudeau clementblaudeau requested review from W95Psp and removed request for a team August 20, 2025 09:48
Copy link
Member

@W95Psp W95Psp left a comment

Choose a reason for hiding this comment

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

Thanks, looks good to me, I have a few minor comments.

@clementblaudeau clementblaudeau linked an issue Aug 20, 2025 that may be closed by this pull request
Copy link
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.

Just a nit and a question.

Base automatically changed from rengine-backend-printer-traits to main August 25, 2025 08:11
@W95Psp W95Psp enabled auto-merge August 25, 2025 10:32
@W95Psp W95Psp added this pull request to the merge queue Aug 25, 2025
Merged via the queue into main with commit fa5615c Aug 25, 2025
17 checks passed
@W95Psp W95Psp deleted the lean-update-printer branch August 25, 2025 11:56
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.

Rust Printer: refactor the Lean backend to use PrettyAst

3 participants