Giter Club home page Giter Club logo

stacker's Introduction

Stacker ๐Ÿฅž

Stacker is a mixed static/runtime analyzer that runs the dependents of a Cabal package of interest to find out how it's used in the wild. Stacker creates a dependency graph of values starting from a function call from a package dependent.

Try it live at http://stacker.lam.io!

Stacker's main goal is to address barriers to adoption of packages and frameworks that arises from skepticism about examples and The Right Way. Instead, let's prefer collecting hard statistics on how people actually use the API. Reciprocally, it also helps package owners identify kludges in their interface.

Stacker uses GHC's cost-centre profiler to collect a stack trace from executing tests on a package dependent. It then analyzes HIE (Haskell Interface Extended) files that contain the ASTs of the sources in the compilation set. In the AST, Stacker follows dependencies of the target package's functions up the call stack and along value bindings to backtrack the arguments to the function of interest as well.

Note: HIE files are a new feature of GHC 8.8.

Try running stacker on itself!

  1. ./run to build the project in target which will be analyzed on the first cycle.
  2. Open target/stacker-fake-pkg.prof and find the cost centre ID for main.
  3. Grab the "Cost centre no." (the fourth column, just after the source location).
  4. Build and run stacker against the target with ./run <main-cost-centre-num> target/stacker-fake-pkg.prof target/hie.
  5. Run stacker against itself subsequently by:
    1. Opening ./stacker.prof and finding the cost center # of a function call of interest;
    2. Stashing the .prof file with $ mv stacker.prof stacker.prof.bak;
    3. ./run <cost-centre-num> stacker.prof.bak hie vendor
    4. You should see a list of graph edges in the dependency graph.

Generally, run accepts a cost center number, the .prof file and any number of directories with HIE files. Stacker built with run will generate HIE files for all its dependencies under vendor/hie.

(2020-08-04) Tests + a usable shell/web UI are underway. The results and input process are changing shortly.

stacker's People

Contributors

acrylic-origami avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.