Coder Social home page Coder Social logo

Comments (12)

cristianoc avatar cristianoc commented on June 16, 2024

Thank you for bringing up this issue, and for our conversation about it.

Here are some preliminary notes for a possible design.
The goal is to guide the user towards progressively replacing exceptions by other mechanisms, such as option or result types.
In truly exceptional circumstances, you would want to just add annotations to acknowledge intentional uses of exceptions and what areas of code are affected by them.
If you use exceptions extensively, and want to continue doing so, this analysis won't be helpful.

Some design thoughts:

  • You need to opt into exception checking.
  • Any function that throws exceptions gives a warning.
  • An annotation is supported to acknowledge that the function throws (those) exceptions.
  • Even when a function is annotated, any user of that function that does not catch the exceptions will get a waring. Unless the user itself is annotated, and so on.
  • Enough knowledge needs to be made available somehow of what library functions throw what exceptions.

from reanalyze.

cristianoc avatar cristianoc commented on June 16, 2024

To test the ideas quickly, one could build an extremely simplified prototype that:

  • Operates at the level of individual value definitions, disregarding nesting.
  • Does not distinguish between kinds of exceptions.
  • Only checks if there is some occurrence of an exception-catching mechanism.

That rough first experiment would be very imprecise, but could give a feel for the process to follow when using such an analysis. Before the full analysis is built.

from reanalyze.

cristianoc avatar cristianoc commented on June 16, 2024

Progress here #29
And here #32

from reanalyze.

cristianoc avatar cristianoc commented on June 16, 2024

#34

from reanalyze.

cristianoc avatar cristianoc commented on June 16, 2024

#35

from reanalyze.

cristianoc avatar cristianoc commented on June 16, 2024

@sgrove this is the first full-featured iteration, except it can't read annotations across files.
So if an annotation is added to A.re, and B.re uses A.re, then B.re will not see any annotations from A.

from reanalyze.

cristianoc avatar cristianoc commented on June 16, 2024

#36

from reanalyze.

cristianoc avatar cristianoc commented on June 16, 2024

#37

from reanalyze.

cristianoc avatar cristianoc commented on June 16, 2024

#38

from reanalyze.

cristianoc avatar cristianoc commented on June 16, 2024

e2a82b0

from reanalyze.

cristianoc avatar cristianoc commented on June 16, 2024

#39

from reanalyze.

cristianoc avatar cristianoc commented on June 16, 2024

A feature-complete version is in release 1.8.0
https://github.com/cristianoc/reanalyze/releases/tag/v1.8.0

from reanalyze.

Related Issues (20)

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.