166 releases

new 0.0.215 May 13, 2024
0.0.213 Apr 29, 2024
0.0.207 Mar 25, 2024
0.0.190 Dec 18, 2023
0.0.26 Nov 30, 2020

#40 in Programming languages

Download history 1727/week @ 2024-01-21 1636/week @ 2024-01-28 1769/week @ 2024-02-04 1396/week @ 2024-02-11 1743/week @ 2024-02-18 3789/week @ 2024-02-25 1800/week @ 2024-03-03 1856/week @ 2024-03-10 2136/week @ 2024-03-17 1864/week @ 2024-03-24 1947/week @ 2024-03-31 2075/week @ 2024-04-07 2065/week @ 2024-04-14 1598/week @ 2024-04-21 1431/week @ 2024-04-28 1323/week @ 2024-05-05

6,660 downloads per month
Used in 21 crates (14 directly)

MIT/Apache

500KB
12K SLoC

HIR (previously known as descriptors) provides a high-level object oriented access to Rust code.

The principal difference between HIR and syntax trees is that HIR is bound to a particular crate instance. That is, it has cfg flags and features applied. So, the relation between syntax and HIR is many-to-one.

HIR is the public API of the all of the compiler logic above syntax trees. It is written in "OO" style. Each type is self contained (as in, it knows its parents and full context). It should be "clean code".

hir_* crates are the implementation of the compiler logic. They are written in "ECS" style, with relatively little abstractions. Many types are not self-contained, and explicitly use local indexes, arenas, etc.

hir is what insulates the "we don't know how to actually write an incremental compiler" from the ide with completions, hovers, etc. It is a (soft, internal) boundary: https://www.tedinski.com/2018/02/06/system-boundaries.html.

Dependencies

~13–25MB
~328K SLoC