News for hackers. Stuff that matters.
Re:Clojure at Netflix (2013) [slides] by darksaints on Thursday November 01, 2018 @06:48PM (#18359162)
No, it's not. Try `(+ 1 "1")` in clojure and clojurescript. In clojure, it produces a runtime exception. In clojurescript it silently errs, resulting in a "11".

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.

Re:Clojure at Netflix (2013) [slides] by didibus on Monday November 05, 2018 @05:09AM (#18381144)
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.

Re:Clojure at Netflix (2013) [slides] by ajss on Friday November 02, 2018 @11:47AM (#18363859)
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.
Re:Clojure at Netflix (2013) [slides] by didibus on Friday November 02, 2018 @03:44AM (#18361266)
Woa, you're right. I had never realized they were compiler warnings and not JS errors. Thanks for the tip.