juvix icon indicating copy to clipboard operation
juvix copied to clipboard

Faithfully pretty print `Internal` and `Core`

Open janmasrovira opened this issue 1 year ago • 0 comments

Currently only Concrete syntax can be printed faithfully to what the user wrote.

  • In many parts of the compiler we need to print Internal and Core (to a lesser extend, at least for now) code. E.g. error messages, repl, type information in the IDE, etc. When printing these fragments of code in Internal or Core we have been careful to print them in a way that they resemble Concrete code, so that it is often very clear what it means and what is the equivalent Concrete code. However, we need a long term solution to print Internal exactly as it was parsed. Eventually, we will need to support this in Core too, especially, when we move typechecking there. This issue will become more and more important as we extend the frontend syntax (#1638, #2126, #1992 etc.).

  • I would say that this should be done after #2002 to minimize the amount of redundant work.

In order to implement this, we should probably use the Info strategy (or something similar) that we are using in Core.

janmasrovira avatar May 24 '23 21:05 janmasrovira