I asked about this here: https://clojureverse.org/t/clojurescript-is-weakly-typed/311...
And documented to what extent types are automatically coerced.
Also got the rational behind this: performance.
And that every new release of the compiler performs smarter and smarter type inference and can warn about more of these cases. Though it still misses some as of now.
People were running a real money service that consumed JSON from another service and it didn't validate the incoming JSON? Wow.
Re:Clojure at Netflix (2013) [slides]
by saosebastiao on Friday November 02, 2018 @06:55PM
(#18367396)
The problem comes from the fact that clojure and clojurescript are two different type disciplines, but people approach them with the same expectations. That exact problem would have errored out if they were running clojure, and a thrown exception is good enough validation for many developers. But because they were duped into a false safety net by thinking clojure == clojurescript, it slipped right underneath their radar.
The compiler correctly infers and warns of the problem, but that is of no use if your inputs change types on you. In the case of the service I'm referring to, an external service started serving up json strings for large numbers, whereas it had previously been json numbers. Since there was no exception produced, it silently corrupted data for a couple weeks before it was caught.