4 ms·
The Clojure's approach is to favour libraries over frameworks. We use Clojure on various style of applications (mainly web and API based), hosted on widespread
by jgrodziski 3y ago
The Clojure's approach is to favour libraries over frameworks.
We use Clojure on various style of applications (mainly web and API based), hosted on widespread infrastructure technologies of Cloud Providers (Kubernetes, PostgreSQL, Kafka, etc.) and it's a breeze: here are our reasons for choosing Clojure https://defsquare.com/blog/why-we-bet-on-clojure https://defsquare.com/blog/why-we-bet-on-clojure
If you want to look at libraries where some people have settled, here are our _opinionated_ takes on libraries that we use on almost every project:
- HTTP: Ring is the de facto way to manage HTTP request (see https://github.com/ring-clojure/ring/wiki/Concepts https://github.com/ring-clojure/ring/wiki/Concepts) supplemented with various "Middlewares" for web-related concerns (security, logging, content encoding, etc. see https://github.com/ring-clojure/ring/wiki/Standard-middleware https://github.com/ring-clojure/ring/wiki/Standard-middlewar...). Jetty and Aleph are common web servers (and https://github.com/clj-commons/aleph https://github.com/clj-commons/aleph) that implement Ring interface.
- Routing: Reitit (https://github.com/metosin/reitit https://github.com/metosin/reitit)
- Single-Page App: shadow-cljs for the build concerns (https://github.com/thheller/shadow-cljs https://github.com/thheller/shadow-cljs), Reagent with Re-frame for complex/large app (https://reagent-project.github.io https://reagent-project.github.io and https://github.com/day8/re-frame https://github.com/day8/re-frame). Even if we now prefer using HTMX (https://htmx.org https://htmx.org) and server-side rendering (Hiccup way of manipulating HTML is just amazing, https://github.com/weavejester/hiccup https://github.com/weavejester/hiccup).
- Schema management: Malli (https://github.com/metosin/malli https://github.com/metosin/malli)
- Lifecycle management: Mount, Integrant or Component (https://github.com/tolitius/mount https://github.com/tolitius/mount https://github.com/weavejester/integrant https://github.com/weavejester/integrant and https://github.com/stuartsierra/component https://github.com/stuartsierra/component)
- Config management: Aero (https://github.com/juxt/aero https://github.com/juxt/aero) and environ (https://github.com/weavejester/environ https://github.com/weavejester/environ)
- Log: μ/log (https://github.com/BrunoBonacci/mulog https://github.com/BrunoBonacci/mulog)
- Time: https://github.com/juxt/tick https://github.com/juxt/tick
- Testing: https://clojure.github.io/clojure/clojure.test-api.html https://clojure.github.io/clojure/clojure.test-api.html and Kaocha for the runner (https://github.com/lambdaisland/kaocha https://github.com/lambdaisland/kaocha).
- Package and project management: tools.deps is simple and powerful (https://clojure.org/guides/deps_and_cli https://clojure.org/guides/deps_and_cli)
For infrastructure stuff (PostgreSQL, Keycloak, Solr, Kafka, etc.), just wrapping the underlying Java library or driver is often enough, and there are lots of wrappers for easing the integration. And we implement Hexagonal architecture style to put all of that in place.
Don't be afraid a libraries not moving a lot recently, it's a sign that the library is mature and battle-tested.
Clojure is a joy to use every day :)
- waffletower 3y agoMentioning μ/log and no mention of timbre (https://github.com/taoensso/timbre https://github.com/taoensso/timbre), that is an odd omission. Malli is a great mention, but there ought to be a mention of clojure.spec (https://github.com/clojure/spec.alpha https://github.com/clojure/spec.alpha) which has much more mindshare.
- jgrodziski 3y agoYes I agree, timbre and clojure.spec are great and I used them a lot, nowadays I move to μ/log and Malli for instance. My comment was to provide some guidance for someone outside of the Clojure community to navigate in the library ecosystem. I updated my comment to reflect that it's an opinionated take and just that.