Closed karlhorky closed 2 years ago
The basic idea is usually called program slicing, of which there are a litany of algorithms. For example, code coverage is a form of dynamic slicing.
The specific algorithm used in Flowistry cannot be easily replicated for other languages, because it is designed to use unique aspects of Rust, namely ownership types.
Ok, thanks for this @willcrichton!
I searched the VS Code extensions Marketplace, but I didn't see anything that does the same as Flowistry (but maybe I'm using the wrong terms - I searched for "program slicing", "focus related", "dependent code", and some others).
One thing that I did realize is that I often use the built-in feature of VS Code which does some kind of similar type-aware highlighting for identifiers (although no dimming of code). So at least there is that! 🙌
https://user-images.githubusercontent.com/1935696/189691471-37bed75f-78f2-4f20-8fc0-395b68ee1161.mp4
I'm assuming I should close this issue, since I imagine you don't plan to support JS/TS with Flowistry, right?
As a (almost unrelated) side note, I also use the Chrome extension Selection Highlighter by @neaumusic to achieve something similar when browsing on the web as well (not only useful for code, also good for speed-reading articles, to extract the important bits and skip over filler):
I searched the VS Code extensions Marketplace, but I didn't see anything that does the same as Flowistry (but maybe I'm using the wrong terms - I searched for "program slicing", "focus related", "dependent code", and some others).
Yes, to my knowledge Flowistry is the only extension of its kind right now. In my PLDI paper, I talk a little bit about what makes slicing hard (specifically modular static slicing), and why you need Rust (or really ownership types) to do it. You can find the paper here: https://arxiv.org/pdf/2111.13662.pdf
As you noted, most IDEs support direct syntactic or type-based reference, essentially extensions of "jump to definition". But as an example of what you need for Flowistry-style analysis: there is no IDE operation for "find all values of this pointer". Slicing requires a more semantic model of the program than syntactic scopes or types.
Hi there, first of all, thanks for creating Flowistry, really cool idea!
Was wondering if it would be possible / simple to apply this to other languages like JavaScript and TypeScript (or if another extension already exists for JS/TS).
Would be amazing to be able to use this, also in teaching!