Skip to content

Commit 851a034

Browse files
bors[bot]Veetaha
andauthored
Merge #3690
3690: ra_hir: add more docs r=matklad a=Veetaha Cited from [hear](https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/hover/near/191446937) Co-authored-by: veetaha <veetaha2@gmail.com>
2 parents a27f5e3 + e669184 commit 851a034

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

crates/ra_hir/src/lib.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@
44
//! The principal difference between HIR and syntax trees is that HIR is bound
55
//! to a particular crate instance. That is, it has cfg flags and features
66
//! applied. So, the relation between syntax and HIR is many-to-one.
7+
//!
8+
//! HIR is the public API of the all of the compiler logic above syntax trees.
9+
//! It is written in "OO" style. Each type is self contained (as in, it knows it's
10+
//! parents and full context). It should be "clean code".
11+
//!
12+
//! `ra_hir_*` crates are the implementation of the compiler logic.
13+
//! They are written in "ECS" style, with relatively little abstractions.
14+
//! Many types are not self-contained, and explicitly use local indexes, arenas, etc.
15+
//!
16+
//! `ra_hir` is what insulates the "we don't know how to actually write an incremental compiler"
17+
//! from the ide with completions, hovers, etc. It is a (soft, internal) boundary:
18+
//! https://www.tedinski.com/2018/02/06/system-boundaries.html.
719
820
#![recursion_limit = "512"]
921

0 commit comments

Comments
 (0)