Stream: t-compiler/rust-analyzer

Topic: patterns in rust analyzer

Coenen Benjamin (Apr 15 2020 at 14:21, on Zulip):

Hi folks ! I have a question about the ids used in ra. For example FunctionId, FileId, ... Is it coming from the entity component system pattern ?

Laurențiu (Apr 15 2020 at 14:24, on Zulip):

I think it's similar. matklad probably didn't arrive at that design from the game engine perspective, but rather from arena allocators, which are often used to reduce the performance impact of dynamic allocations.

Coenen Benjamin (Apr 15 2020 at 14:30, on Zulip):

Ok thank you @Laurențiu Nicola :D Another question haha, is the "interning" pattern also used in ra ? If yes, for which use cases ? With what is called the green nodes ?

Laurențiu (Apr 15 2020 at 14:35, on Zulip):

Green nodes are one place (see also the comment in Not sure about others. I think it also shows up in the salsa integration and with chalk (but there we don't really intern anything)

Laurențiu (Apr 15 2020 at 14:39, on Zulip):

(there's a bit of overlap between ECS, arenas, interning and "data-oriented design", so.. yeah)

Coenen Benjamin (Apr 15 2020 at 14:40, on Zulip):

Great, thank you. I have to figure out how green nodes and deduplication are made. I don't fully understand all these parts. Thanks for your help and giving me some insights.

Laurențiu (Apr 15 2020 at 14:57, on Zulip):

No worries. I'm not terribly familiar with the code myself so I can't tell you much more.

Last update: Jul 27 2021 at 21:00UTC