3 ms·
> In practicality how difficult/easy is it to build cross-runtime libraries and how much reuse can you get out of clojure libs b/c of its hosted status? It dep
by arohner 11y ago
> In practicality how difficult/easy is it to build cross-runtime libraries and how much reuse can you get out of clojure libs b/c of its hosted status?
It depends on what you're trying to do, and whether the platforms help.
Doing something 'pure' like math or datastructures: trivial. Writing a common interface to two different host libraries (e.g. DateTime in JVM & Browser): manageable.
Doing something 'host-y', like graphics, with no host libraries in common: very hard.
Basically, Clojure doesn't get in the way of cross-platform concerns, but it might still be a difficult problem.
- harlanji 11y agoTo add, it's not great at the moment and will be more confusing until Clojure/ClojureScript 1.7.x is the minimum supported due to the introduction of reader conditionals (cljc), as they're not backwards compatible. Cljx is the old method that cljc should obviate, but there'll be a transition period. I work for a SaaS/PaaS company using Clojure internally for 2 years and was looking into making a universal client (jvm, clr, js, ios, android)... I'd surely have used a Cljx core with Lein profiles for each platform prior but now it's up in the air, may still have to go that way if we're supporting older Clojure. Each approach on its own is easy, but now there are two and the unofficial one (cljx) is more widely supported than the official one (cljc).