3 ms·
As someone alluded to, Interop can be frustrating with big frameworks. Interop also relies heavily on reflection, and may require type hinting once it becomes
by janetacarr 4y ago
As someone alluded to, Interop can be frustrating with big frameworks.
Interop also relies heavily on reflection, and may require type hinting once it becomes a performance problem. Interop also implies the use of side-effects since we're relying on Java object. While a lot of Clojure's sequence and collection operations do work on Java sequences and Collections, it's not perfect and very easy to get bitten, requiring a Clojure.walk/postwalk and zipmap with coercion to get a good Java->Clojure container/sequence/collection.
If we used interop for everything mundane, Clojure would really just be an S-expression shaped husk over Java code. Not a very great solution imho.
- didibus 4y agoI'll politely disagree. The mundane libraries I think you're talking about tend to be about IO, that's always going to be side-effectful in nature. Their APIs wouldn't be all that different even if implemented directly in Clojure. Type hinting isn't hard or time consuming, literally you can take 10min and have everything type hinted. Now I don't know about big frameworks, maybe I don't find a need for big frameworks? But even then, what kind of framework are you talking about? Using Spring MVC for example?