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

Use id_arena and InternedString in the compiler #12

Closed
tomoyanonymous opened this issue Aug 4, 2024 · 0 comments
Closed

Use id_arena and InternedString in the compiler #12

tomoyanonymous opened this issue Aug 4, 2024 · 0 comments

Comments

@tomoyanonymous
Copy link
Collaborator

In the current implementation, compiler clones many String value and comparing them.
Use StringInterner crate will improve the performance.

https://docs.rs/string-interner/latest/string_interner/

Also, recursive type definitions in the Expr and Type are realized simply with Box<Self>, however, this this will make a implementation
of interactive inspection of values difficult, for example, for the language server. Using id_arena simplifies this situation, along with performance improvements.

They are tested on my another project otopoiesis (an experimental branch)

https://github.com/tomoyanonymous/otopoiesis/blob/372bfb7b5c760744f69532c63e8804878a84397d/otopoiesis_lang/src/expr.rs#L31-L32

https://github.com/tomoyanonymous/otopoiesis/blob/372bfb7b5c760744f69532c63e8804878a84397d/otopoiesis_lang/src/lib.rs#L25-L28

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

No branches or pull requests

1 participant