3 ms·
I used Clojure (and ClojureScript) in production for several years, and more or less share your sentiments on this. The only strong objection I have is that the
by eyelidlessness 6y ago
I used Clojure (and ClojureScript) in production for several years, and more or less share your sentiments on this. The only strong objection I have is that the lack of types made even simple data structures an occasional nightmare. Especially when most of the composite types can easily be substituted for many functions, it’s trivial to accidentally recurse a string or a keyword where a data structure should be. And the runtime errors (especially in cljs) can be utterly baffling.
I’ve taken what I learned in clojure (and I can just say the article, even just its title, adequately sum it up) and use the same approach in TypeScript. And it’s a breath of fresh air.
- m45t3r 6y agoI didn't say anything about types, but we use plumatic/schema as a "type system". It is not ideal (for once, it is checked at runtime instead of build time, so we only check types during tests and requests, otherwise the impact would be too great). It is not ideal, but it works and keeps our sanity.
- eyelidlessness 6y agoYeah something like that is essential in a dynamic language. To be honest though I don’t think I could go back to runtime-only type checking and having to write those tests where a compiler tests so much automatically.
- dragonwriter 6y ago> where a compiler tests so much automatically Compilers don't necessarily check anything. Static analysis tools (including static type checkers) check things, and some compilers also include static analysis tools. But static analysis tools are often available beyond whatever a compiler provides.
- fiddlerwoaroof 6y agoAnd, some compilers (sbcl) can do fairly sophisticated static analysis on dynamically typed code.
- eyelidlessness 6y agoYes, you’re right. It’s often but not always the case that type checking and compilation are part of the same tool and flow. Thanks for adding that.
- nickbauman 6y agoHave you considered Clojure Protocols for this?
- eyelidlessness 6y agoI used them. But they’re still runtime-only.