πŸ“• subnode [[@jakeisnt/clojure]] in πŸ“š node [[clojure]]

Clojure is… weird. It's a lisp that attempts to be immutable, concurrent, opinionated, and pragmatic, geared towards prioritizing practical, comprehensible application development. The language accomplishes this by forwarding the idea of different clojure dialects along with the idea that any macros or complex logic should be left to libraries - so that the programmer just has to glue the library pieces together and worry about the domain of applicaiton.

Libraries

  • hickory: parse html into clojure data structures

  • tongue: i18n

  • sci: builtin clojure interpreter for scripting and DSLs

  • dommy: clojurescript DOM manipulation library

  • medley: useful, pure functions missing from clojure.core

  • datascript: an immutable in-memory database and datalog query engine running in the browser

  • rum: client server library for html ui in clojurescript. works as a React wrapper.

Frameworks

Fulcro

Passing functions between front-end and backend is cool, so is convenient integration with many of the databases - but treating the site as a monolithic interface from which data can be queried feels so different from React's mindset of avoiding global state and exposing the minimum amount of data necessary for the system to function as a whole.

I really like the shadow-cljs approach and think NodeJS is more fun than working with Java on the backend (despite whatever potential performance caveats may come from that) but it's unclear whether the monolithic query approach - one that partially but doesn't completely obfuscate the network connection - is net beneficial or just confusing for the end user.

Reagent

This is much easier to use than Rum, but has caveats: it doesn't have any mixins and uses its own implementation of atoms rather than falling back to React's lifecycle/hooks APIs or Clojurescript's. This makes it easier to use and more of a 'framework' - all of your code happens inside of the Reagent component ecosystem, unlike Rum - but is a bit harder to get creative with and doesn't feel like it's in the spirit of Lisp's easily composable libraries.

πŸ“– stoas
β₯± context