Skip to content

Faithfully pretty print Internal and Core #2129

@janmasrovira

Description

@janmasrovira

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 (Recursive lambdas #1638, Iterator syntax #2126, Special syntax for folds, maps, etc #1992 etc.).

  • I would say that this should be done after Remove Abstract #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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions