Comments (12)
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.
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.
Progress here #29
And here #32
from reanalyze.
from reanalyze.
from reanalyze.
@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.
from reanalyze.
from reanalyze.
from reanalyze.
from reanalyze.
from reanalyze.
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)
- `-write` removes trailing newline from modified file
- Binding operators are incorrectly marked dead HOT 1
- Use single dead annotation if entire module is unused
- Awkward record field dead attribute placement with unusual record formatting HOT 3
- Re-exported variant is incorrectly marked dead HOT 1
- Interpret OCaml compiler's unused value declaration warning suppression attribute HOT 1
- Confusing dead code warning at module include HOT 1
- When a function is annotated `@dead` values inside it are reported dead. HOT 10
- Module incorrectly marked dead when contains non-dead type and submodule definitions HOT 1
- @dead annotation breaks rescript compiler on a destructured value HOT 3
- decorating functions in pipe chains? HOT 4
- Dead Types wrt consumed types HOT 7
- False alarms for native projects that generate new files HOT 9
- [Feature Request] Support `globs` for `suppress` and `unsuppress`.
- [Feature request] Integrate with `@deriving({abstract: light})` HOT 13
- Interface of sub module are not seen used HOT 3
- -write produces syntax error in OCaml w.r.t. destructive substitution on module-items and tuple pattern-matching HOT 4
- Catching on exception from other module leads to incorrect warning HOT 3
- Include Darwin arm64 builds in the NPM package HOT 5
- False Positive When Using First Class Module Type Alias
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reanalyze.