4 ms·
I am intrigued by the mention of writing AST walkers and a data flow tool for call graphs. Is it possible that you can talk about them on a blog post ? I would
by whitten 8y ago
I am intrigued by the mention of writing AST walkers and a data flow tool for call graphs. Is it possible that you can talk about them on a blog post ? I would like to know why they are useful and how you write them.
- awinter-py 8y agonot sure there's a simple codebase to study for learning this stuff, but most sophisticated linters or static analyzers will have some amount of dataflow. At minimum you're going to be managing nested scopes, resolving names to values and assigning types to names. Sample PR from the eslint project that has all these elements: https://github.com/eslint/eslint/pull/10020/files https://github.com/eslint/eslint/pull/10020/files IMO dataflow is more useful for dynamically typed languages. In static languages where the type of every name is declared somewhere, tracing values through local scopes and function calls isn't as critical (though still valuable).