#graph #scope #research #definition #documentation #name #resolution

scopegraphs

A port of scopegraphs https://pl.ewi.tudelft.nl/research/projects/scope-graphs/ to Rust

9 releases

new 0.2.6 Apr 24, 2024
0.2.5 Apr 24, 2024
0.1.3 Apr 19, 2024
0.1.2 Mar 30, 2024
0.1.0 Nov 15, 2023

#462 in Algorithms

Download history 10/week @ 2024-02-19 10/week @ 2024-02-26 53/week @ 2024-03-11 129/week @ 2024-03-25 45/week @ 2024-04-01 123/week @ 2024-04-15 545/week @ 2024-04-22

737 downloads per month

MIT/Apache

180KB
3K SLoC

Crates.io MSRV docs.rs GitHub Actions Workflow Status

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–2MB
~40K SLoC