Comments (8)
When talking about infinite recursion: There is bad-recursion.md in the elm-compiler
repository where @evancz describes what the compiler is currently doing. Quite an interesting read, if you don't know it already.
Elm will allow recursive definitions as long as there is at least one lambda before you get back to yourself. [..] Anyway, I just thought it was cool that we cannot solve the halting problem in general, but a simple rule about lambdas can detect the majority of bad cases in practice.
from elm-analyse.
It would be especially intersting if it's not tail recursive.
But recursion in general is not something that has to be fixed, right? So why do we want to have a warning?
from elm-analyse.
@andys8 You're right, the title was misleading. I was aiming for just an indicator like in the screenshot. The project owner can freely close this issue if it's out of scope :)
from elm-analyse.
How about suggesting this feature with a visible indicator to the creators of the IDE plugins? For example VScode or Elmjutsu for Atom
from elm-analyse.
@andys8, the issue was created by the author of Elmjutsu :).
As for now, I want the violations in elm-analyse to be kept to "things that you do not want to have in your project", instead of "context-dependent bad".
Having the first property will decrease the need for issues such as #92, and increases the use of elm-analyse in combination with CI.
So, if this will be implemented, is there a well-known algorithm to detect if it is not tail-recursion?
I'm not really familiar with it.
from elm-analyse.
Haha, I didn't know that. So I basically advised @halohalospecial to do it on his own ^^ By the way, great plugin @halohalospecial :)
from elm-analyse.
My initial thought was to have indicators to remind the devs that there are calls that may cause infinite recursions (which will only appear in production). They may not be aware that calls are recursive (e.g. function A calls function B, which calls function C, which calls function A), or they may have written the incorrect function names (which they expected to be non-recursive). The compiler doesn't notify them of these scenarios.
I understand that this feature may be out of scope since it is context-dependent and not really a bad practice. It will just tell the devs to be wary about certain parts of the code and make sure that they really want recursion in those parts.
I'll ask Elmjutsu's creator if he is willing to implement this 😆
from elm-analyse.
Thanks for the link, @andys8!
from elm-analyse.
Related Issues (20)
- All "Project Dependencies" showing "Unknown" status HOT 1
- Option to not load certain files
- Suggestion: Don't warn about unused import aliases in some edge cases HOT 1
- Unused dependencies check does not consider Elm code in node_modules
- Useless import alias
- Parsing error when function argument rec deconstruction is empty HOT 3
- vscode CPU consumption
- Use Cons Over Concat question HOT 2
- Parsing error with no explanations when tab indents in file
- FileLoadFailed error for elm-visualization module HOT 2
- Incorrect "Unnecessary parens" HOT 1
- Allow disabling check for file, next to skipping complete file
- Support for symbolic links
- excludedPaths does not work expectedly on Windows
- Scandinavian characters causing 'Error parsing file'
- Update node-watch so recursive watch is enabled on linux
- Empty record pattern matching (destructuring) causes parse error
- Upcoming release that bumps `minimist` to >=1.2.5
- Check Option suggestions
- Is this still being maintained? HOT 8
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 elm-analyse.