Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate non-natural tree embeddings #124

Open
matklad opened this issue Nov 14, 2021 · 0 comments
Open

Investigate non-natural tree embeddings #124

matklad opened this issue Nov 14, 2021 · 0 comments

Comments

@matklad
Copy link
Member

matklad commented Nov 14, 2021

Today, Rowan's logical tree shape is identical to the physical shape of the tree data structure. That's natural (you might even wonder what is the other option), but is not necessary optimal. In particular, natural tree sometimes have very wide nodes with hundreds of children. Traversing or modifying such nodes sometimes is O(len(children)), which might give poor worst-case complexity.

An alternative is to make sure that the physical shape of the data structure is always a ballaned tree. For example, we can introduce a TRANSPARENT SyntaxKind, and represent long sequences as deep, balanced trees with TRANSPARENT internal nodes.

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

No branches or pull requests

1 participant