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 ?
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.
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 ?
Green nodes are one place (see also the comment in https://github.com/rust-analyzer/rowan/blob/master/src/green/builder.rs#L15). 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)
(there's a bit of overlap between ECS, arenas, interning and "data-oriented design", so.. yeah)
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.
No worries. I'm not terribly familiar with the code myself so I can't tell you much more.