21 releases

0.3.3 Nov 22, 2024
0.3.2 Jun 6, 2024
0.2.18 Jun 4, 2024
0.2.6 Apr 24, 2024
0.1.0 Nov 15, 2023

#75 in Programming languages

Download history 15/week @ 2024-09-22 6/week @ 2024-09-29 1/week @ 2024-10-06 116/week @ 2024-11-17 41/week @ 2024-11-24 22/week @ 2024-12-01

179 downloads per month
Used in scopegraphs-macros

MIT/Apache

515KB
11K SLoC

JavaScript 7.5K SLoC // 0.0% comments Rust 4K SLoC // 0.0% comments TypeScript 17 SLoC // 0.5% comments

Crates.io MSRV docs.rs GitHub Actions Workflow Status

Warning

This software is actively being developed, tested and documented. Most features work, but we cannot guarantee api stability just yet, nor is the documentation as good as we want it to be. If you don't understand something, feel free to either document it for us, or let us know.

This library is not ready for production usage

Scope graphs are an abstraction that allow you to express the complicated name resolution patterns that many programming languages have. Put simply, a scope graph encodes what names are defined in which scopes of a program, and how scopes relate to each other. Then, we can run queries over this graph to create links from usages of names to definitions of names. However, to make name resolution flexible, the building of the graph and the querying over the graph can happen concurrently: we don't need an entire graph before we can start querying it.

This library, and its documentation serve as both a kind of reference implementation of scope graphs, a usable library for your programming language, a tutorial of how to use scope graphs and a tutorial of how you could implement scope graphs yourself.

Research

Scope graphs are based on research. These are some papers that introduce the topic in a more scientific fashion than we will here. That is on purpose: The documentation of this library are meant to be the more informal explanation of scope graphs.

But more research is ongoing! See our research overview page for an overview of all research that involves scope graphs.

Dependencies

~1.3–2.3MB
~43K SLoC