Git Product home page Git Product logo

ddebug-rs's Introduction

ddebug-rs

A differential debugger for rust source code. The tools tries to minimize input rust code into it's minimally reproducable version throwing the same error as before. Rather than trying to remove characther by characther the tool relies on AST.

Example

For the example project (located in the repo's test folder as well) containing the following code piece, ddebug-rs able to minimize the code into its more compact form.

fn main() {
    let b = 0;
    let a = 0;
    let c = 0;
    b = 10;
}
> ddebug-rs
Minimized the code into:
fn main() {
    let b = 0;
    b = 10;
}

High level overview

Given a path, or the current path the cli is invoked, cargo build is called with some filters to understand what type of errors the given input rust code creates first. After deciding the target error and the file it is sourced from, the tool parses that file into an AST. AST nodes are traversed and by removing and retrying the build process actual required set of nodes are determined. One thing to note here is that ddebug-rs tries to remove large nodes first to mark entire subgraphs of AST unnecssary. So it should be a faster than a standard delta debugging tool trying to rely on string manipulation.

Notice

  1. ddebug-rs is written in a weekend and mostly stands as a POC, lots of unnecessary clone's are in the code-base due to my laziness. So by performance standards it is far from optimal.
  2. ddebug-rs does not cover the entire rust syntax space, it is covering a very little subset of valid syntax which is something I will be working on from time to time.

As mentioned above the project is by no means optimal. Happy to take in any contributions, especially around the 2 points given above

Contributions

Highly appreciated.

ddebug-rs's People

Contributors

kayagokalp avatar

Watchers

 avatar

ddebug-rs's Issues

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.