News for hackers. Stuff that matters.
Re:Safe dead code removal in a pure functional language by zepatrik on Thursday January 28, 2021 @04:12PM (#25949290)
It would actually make sense to have linter rules in javascript to report impure functions and avoid them as much as possible. But as the article said, JS is kinda broken already as you can have proxies and stuff that possibly adds side effects to the most basic expressions.
Re:Safe dead code removal in a pure functional language by jfmengels1 on Thursday January 28, 2021 @04:17PM (#25949363)
The article author wrote this ESLint plugin to do just that https://github.com/jfmengels/eslint-plugin-fp

then he (I) happily switched to Elm, because even with a lot of static analysis rules, it's really hard to avoid impure functions when a lot of the libraries and existing code use that, and sometimes even require that.