Heya! -- I'm trying to get more familiar with Rust's parser infastructure, and one thing I'm unclear about is what the role of
rowan is and what the role of
ungrammar is. Both seem to be used within Rust-Analyzer -- and it seems I might be missing a bit of understanding what each of these is best suited for?
Rowan is a data structure for a concrete syntax tree. The parser, the code that turns text into a rowan tree, is the
parser inside rust-analyzer.
Concrete syntax tree is dynamically typed (think
ungrammar is tool we used to layer typed access methods over the underlying tree.
ohh, yes okay that makes sense
@Laurențiu Nicola hehe, yeah I've been combing over that article for the past day -- I had some trouble getting the relationship between the various components click
There's also a bunch of notes and links in https://github.com/KirillOsenkov/Bliki/wiki/Roslyn-Immutable-Trees
oh! -- I've heard of Roslyn, will check it out -- thank you!
I don't remember much of the details, but I think Roslyn was the first implementation (for C#),
libsyntax took a similar approach, but doesn't rely as much on a GC, and
rowan is still evolving.
matklad can surely say more :)
hmm, question: I believe Rust-Analyzer is considering moving to mutable trees at some point in the future? - would that deviate much from how Rust-Analyzer's components work today?
/me realizes they should read the mutable tree RFC more closely