Stream: t-compiler/rust-analyzer

Topic: Replace hir replaced by graph


Mr Smeet (Nov 09 2020 at 09:43, on Zulip):

How do you look at to remove the hir and replace it with a graph database or own graph implementation with query language?

matklad (Nov 09 2020 at 09:50, on Zulip):

Depends on which level of hir we are talking about.

For the public API visible to the client of rust-analyzer (code_model.rs), it should be pretty straight-forward to add additional access methods (albeit this still requires a ton of work, the API is not small).

For the implementation of rust-analyzer, I don't know -- I guess, this means rewrting salsa to be based on graph data model, which sounds like research problem.

Mr Smeet (Nov 09 2020 at 09:54, on Zulip):

I want to understand in general whether such a patch will be considered?

matklad (Nov 09 2020 at 10:01, on Zulip):

It definitely would be an interesting approach to look at. It is true that the current code_model API is pretty unprincipled. Something with he http://www.stroustrup.com/gdr-bs-macis09.pdf level of scholarship would be much appreciated.

But, with my baseline understanding of problem space, I'd estimate the probability of success for graph db approach specifically to be pretty low -- maybe an order of magnitude lower than for traditional OO style code model tries to follow now.

So, it's unlikely that we'll accept an incomplete version in-true for the purposes of experimentation (as P of success doesn't outweigh maintenance cost), but we obviously won't be able to say now if a sufficiently complete thing exists and proves to be better than the current approach.

Last update: Jul 28 2021 at 04:30UTC