hax icon indicating copy to clipboard operation
hax copied to clipboard

[META] Frontend completeness

Open W95Psp opened this issue 1 year ago • 1 comments

We want the frontend of hax to be complete, that is:

  • all Rust constructs should be handled;
  • the frontend shall not crash.

Currently the main pain with frontend is traits: we implement our own logic for finding implementations for traits. This part is the only "smart" part of the frontend, I would say. This trait implementation resolver is the only part of the frontend where we (1) go deep down rustc's AST (2) reconstruct some complicated data and ask Rust something. Here "reconstruct some complicated data" involves binders: we have a hard time reconstructing binders correctly, thus we break invariants and rustc crashes.

List of bugs:

  • https://github.com/hacspec/hax/issues/747
  • https://github.com/hacspec/hax/issues/686
  • https://github.com/hacspec/hax/issues/684
  • https://github.com/hacspec/hax/issues/604
  • https://github.com/hacspec/hax/issues/310
  • https://github.com/hacspec/hax/issues/875

Ccing @R1kM @Nadrieril @sonmarcho who are probably interested

Action items

  • [ ] Catch those failures and print nice warnings
  • [ ] Add item-wise catches? to improve UX
  • [ ] #944
  • [ ] How long would that take?

W95Psp avatar Oct 02 '24 07:10 W95Psp

Relevant:

  • #977

W95Psp avatar Oct 08 '24 16:10 W95Psp

We fixed all the issues here, the only one left is https://github.com/hacspec/hax/issues/1046, which is related to GATs The plan is for the engine to move to @Nadrieril's great new enum FullDef, which gets rid of HIR construct, which is a bit of a technical debt. https://github.com/hacspec/hax/issues/1072 tracks that.

W95Psp avatar Oct 30 '24 07:10 W95Psp