4 ms·
- Clojure without clj-kondo - PHP without phpstan/psalm/phan All bad ideas, modern tooling can detect errors in your code before you finish your code expressi
by slifin 5y ago
- Clojure without clj-kondo
- PHP without phpstan/psalm/phan
All bad ideas, modern tooling can detect errors in your code before you finish your code expression, but you do need to go out of your way to setup it up
Most people do not
and then complain about types instead of talking about static analysis
If you are ever coding Clojure you should be following this:
https://github.com/clj-kondo/clj-kondo/blob/master/doc/editor-integration.md https://github.com/clj-kondo/clj-kondo/blob/master/doc/edito...
- YuukiRey 5y agoI use kondo already, and while it's a nice tool it doesn't solve my problems.
- slifin 5y agoCan you be more specific? There is a primitive type annotation checking system in there, kinds of mistakes not being caught will likely be of interest to Borkdude and others
- YuukiRey 5y agoThe features of the Rust and Haskell type systems that are most useful to me are requiring me to handle every possible null value and modeling branching control flow with algebraic data types, including exhaustiveness checks for those. A value of type "User" can be either "LoggedInUser", "Admin" or "NotLoggedIn", and each of those can have data attached to it. Now I can write functions that only work on specific versions of this and the compiler will remind me to handle every possible variation. If I've narrowed it down to "this function only takes Admin", then the compiler will prevent me from passing the wrong type to it. It's little things like being able to wrap a "String" in a so-called "newtype": "newtype SpecialString = SpecialString String". Now a function can happily accept three string arguments, but if each one is wrapped in a special type you can't mix them up. Or saying something is a "NonEmptyList" and now I can rest assured that it'll always have values. If any of these can be achieved reliably (<-- important!) in Clojure then I apologize for my lack of knowledge!
- xfer 5y agoYes, just use C with asan, msan, valgrind and frama-c. Why invest in types?
- willtim 5y ago> then complain about types instead of talking about static analysis Static types are a form of static analysis. One that is deeply integrated into the language and compiler, which gives obvious advantages such as machine-checked documentation, custom invariants and error messages (expected a Currency but got a Country), better code generation, better tooling (IDE pop-ups, fast incremental checking) etc. Other forms of static analysis are of course useful too.
- void_mint 5y agoIt seems like if a tool is so essential to successful development in a language, it should probably not be a 3rd party library but instead baked into the language tooling itself, no? (I have never used Clojure and am not trying to be inflammatory)