4 ms·
Libraries like this are an argument for dynamic types. In Clojure, all libraries work with associative or sequential collections, which is why you can compose s
by vnorilo 7y ago
Libraries like this are an argument for dynamic types. In Clojure, all libraries work with associative or sequential collections, which is why you can compose supdate with literally anything.
We do lose the embedded proofs that statically typed APIs give. We regain some of the confidence with clojure.spec'ing them.
I wonder if there's a way to make a compile time spec - enforce contracts at API boundaries, but let stuff like supdate work in a highly generic way in between. C++ templates and Rust traits could work, but everyone would need to agree on a core set to use.
- jdc 7y agoRegarding compile-time spec checking — Spectrum is working toward just that. https://github.com/arohner/spectrum https://github.com/arohner/spectrum
- kimi 7y agoSpectrum would be great, but I think it's still way off from being usable. Taking a line from Specter's page, static analysis that catches idiotic bugs (es mis-typed keys) would really be "Clojure's missing piece". I have been trying it on and off for a bit of time now, but it still breaks on anything but the simplest cases.