Clojure Web Development Evolved [video]
youtube.com
youtube.com
I love Clojure, but this language is going to die off if people don't start putting more effort into building mundane, everyday libraries. (I know I am). Clojure has high velocity, but it's always offset by having to create new libraries or update rotting ones.
I've noticed a ton of software rot in what were once major Clojure libraries, like Onyx and Cortex, now fading into obsolescence.
I'm sorry, but I will keep bitching about this on HN until people help me.
It's these API-wrapping and protocol-handling type libraries that either are way out of date, or just don't exist.
I don't think it is the building, so much as the burying that needs more work, so that we know what libraries do or don't need tombstones.
To the best of my knowledge, Onyx and Cortex were both backed by companies which either needed to move onto more successful products, or in the case of Cortex, they closed up shop. It might be better to look at libraries that have stronger community support.
Onyx is an amazing library but it competes with other libraries like KafkaStreams which has community buy in, and commercial support if needed.
Cortex might be replaced with mxnet which got clojure bindings sometime in the last couple of years (see gigasquid). (Although libpython might make this redundant -- assuming language purity isn't a blocker to being pragmatic).
Others will have better examples, but here are some simple ones that are well maintained, but lets not forget that the java ecosystem is also available:
clojure clojurescript core.async mxnet integrant
Its good to remember that what might be considered "rot" in some ecosystems, is just a sign of maturity and of a library being finished. Many older libraries with no commits in years function as is, as documented.
I’ve noticed that pattern in the lisps and Erlang. Things are dead, they just don’t really need any changes.
If Onyx had been the first, it could have become what Spark is, possibly.
My point being, I don't really think every language needs a distributed compute, just need one and have bindings from your language to use it. Clojure being Java has access to many bindings for many of those popular libraries.
I think most Clojure libraries rightfully focus on things that either only possible or needed in Clojure. Things like core async, typed clojure are not even possible to implement in other languages as libraries.
When thinking of examples: the cognitect/aws-api is amazing in it's ease and fun, yet AWS Java SDK is also easy to use from clojure. I prefer the former, but there isn't anything wrong with the latter.
It works beautifully, and the REPL helps with all of it.
Things that are difficult to interop are java annotations based stuff, having to implement interfaces or subclass classes, and functional interfaces.
But you can use Spring without annotations, which is my preferred way anyways, because I favor explicit over implicit.
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.
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?
I'll start today.
It’s kind of a tragic irony. Clojure gives a solo dev enough leverage to create such a library. But because it only needs one dev to create it, the bus number stays at 1.
Many Clojure libraries are conceptually simple and solve one problem well, so it's common for them to reach 'feature completeness' and not see much activity after that. clj-commons has also ensures the active future of many libraries.
A friend and I adopted a library we felt was stagnating and still had lots of useful features to add. I don't see this more in Clojure than anywhere else though.
Any more examples that need engineers? Onyx always seemed to be entering a crowded space.
I just don't like its enigmatic stack traces when an error occured-- it was difficult to understand the how/why/where of errors.
I did not like its relation to with Java. Nor the Java tooling. And ReAgent isn't exactly foolproof. ReAgent felt... buggy, and certainly not as easy to use as I felt ReactJS is. (ReAgent compiles to ReactJS)
Then again, it has been about 3 years, maybe I'll try it again sometime. Or at least another functional programming focused language.
I liked Clojure, but I was happy to return to NodeJS & ReactJS-- the latter being in higher demand, and felt easier to work with in terms of stack tracing, build system, and debugging. But yeah, as a language, Clojure itself is nice to work with.
Also the REPL makes it so easy to debugging: https://www.cognitect.com/blog/2017/6/5/repl-debugging-no-st...
https://www.youtube.com/watch?v=3HxVMGaiZbc
"ClojureScript in the Age of TypeScript — David Nolen"
Skip to 30:00 for the live coding demo: https://youtu.be/3HxVMGaiZbc?t=1800
The slow start times are meaningless for long lived servers, which Clojure is best suited for. For fast startup time there is now Babashka which is great for many tasks, and GraalVM as another option.
By leaky, I assume you are refering to the interop with the host platform. Overall, this seems like a benefit, simply for having access to many more libraries than would otherwise exist in Clojure(script).
> Clojure brings all the XML pain of Java dependencies
Do you mean pom.xml?
> better VM
The JVM seems extremely powerful with regards to performance and memory management, with 20+ years of backwards compatibility (mostly), and improvements still being made with GC and JIT.
You don't have to use pom.xml for Clojure projects. The default, included-with-the-clojure-cli support to define your dependencies in deps.edn makes dependency management extremely simple
;deps.edn
{:deps {org.postgresql/postgresql {:mvn/version "42.4.0"}}}