Skip to content

De-Gc the AST #7929

Description

@huonw

It would be really nice to have an AST that was a tree with ~. This would have countless advantages, like the ast-fold could consume the AST and only allocate if it is actually creating a new node, and we'd generally not have the problems associated with Gc (the GC might be able to land!).

However, there are a few areas that are very tricky; mainly the AST map, which maps node_id to actual AST nodes of various types, the only safe way to do this with an ~ tree is with & references... which freezes the AST for the remainder of the program, so no transformations like constant evaluation, and no consuming of the AST by trans.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.E-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.metabugIssues about issues themselves ("bugs about bugs")

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions