August 31, 2020
By: Kevin

Clojure&ClojureScript's Arsenal of Libaries

  1. JSON
  2. HTTP CLIENT
  3. WEB SOCKET
  4. STATE MANAGEMENT
  5. TIME & DATE
  6. SQL
  7. Excel
  8. COM PORT
  9. PDF
  10. SCHEDULER
  11. LOGGING
  12. LINTER
  13. ROUTING
  14. SCRIPTING
  15. WEB
  16. DESKTOP
  17. iOS & Android

arsenal

I started learing & using Clojure from 2015, after watching a talk by Rich Hicky, and our team has been using Clojure as power hourse for more than one year, and never look back.

We gradually find the following libaries essential. Some of them are Java Libaries, well, that's life, live with it.

JSON

cheshire is a great choice for decode/encode JSON. Clojure only.

HTTP CLIENT

clj-http, wrapping Apache HttpComponents client. Workis like a charm. Clojure only.

WEB SOCKET

sente makes it easy to build eliable, high-performance realtime web applications with Clojure + ClojureScript.

STATE MANAGEMENT

mount, for backend it's a libary I can live without, it also works for cljs(I have not tried much, yet!)

TIME & DATE

java-time is a wrapper for java8 Date-Time API friendly and fun to use.

cljs-time A date and time library for ClojureScript, imitating the API of the clj-time library. Programmers from JS background may choose MonentJS, for me, cljs-time is more to my taste.

SQL

HugSQL say goodbye to ORMs and live happly ever after. Its snippet is very versitile and fun to work with. I have adapted it's core to support mysqlx template, takes my only hours to get it working.

Excel

Docjure is pleasent and EasyExcel is fast.

It's a pity that eassexcel is a Java libary, using java annotation heavily make it even harher to interop with.

COM PORT

JSerialCommm, as its name applies: Platform-independent serial port access for Java.

Works well with com port driven hardware.

PDF

clj-pdf table, fonts, bulletin, watermark, you name it, works great, clj only.

SCHEDULER

chime works great for our need, clj only.

LOGGING

Timber works for both clj/cljs, easier to configure than log4J or any other Java logging libary.

LINTER

Knodo-cljs it surely delivered what is promised: "A linter for Clojure code that sparks joy.", works for edn, clj/cljs/cljc.

GraalVM based, no cider session required, blazing fast and no bunden on editor.

ROUTING

Reitit works for both web frontend and ring handler backend, it's data driven, fast and pleasent to use.

For all the libaries listed here, Reitit is more on the framework spectrum than most.

SCRIPTING

Babashka "Life's too short to remember how to write Bash code. I feel liberated" .

Another GraalVM based tool/libary.

WEB

'(Shadow-cljs Reagent re-frame kee-frame)

DESKTOP

(conj Web-libaries 'Electron)

iOS & Android

(conj Web-libaries 'React-Native)

Tags: clojure