News for hackers. Stuff that matters.
Re:Using Clojure for Web Apps by lgessler on Thursday December 12, 2019 @12:59PM (#21774363)
Some of my favorite Clojure libraries in this space:

- instaparse: takes EBNF (and other formats) as a string and gives you a parser instantly (!!!) https://github.com/Engelberg/instaparse

- re-frame: React-Redux alternative that IMO is much easier to work with https://github.com/day8/re-frame

- reagent: React wrapper https://reagent-project.github.io/

- ring https://github.com/ring-clojure/ring

- fulcro https://github.com/fulcrologic/fulcro

More than any library, though, what keeps bringing me back to Clojure is its incredibly blissful set of persistent data structures. It's a pernicious accident of history that we are taught to accept references to mutable objects as normal, inevitable, and desirable in most CS curricula. It is much easier to develop, debug, and maintain immutable data structures instead, and I consider my good fortune every time I get to debug something in Clojure rather than in some reference-laden OOP soup.

Re:Using Clojure for Web Apps by davezuko on Thursday December 12, 2019 @03:00PM (#21775717)
re-frame is seriously an awesome library, with incredible documentation to back it up. I remember spending a few days reading through all of it and coming out wildly impressed.

In case anyone is interested in its ideas but is stuck with JavaScript, you may be interested in a vanilla JavaScript port I've been (very sporadically) working on: https://github.com/davezuko/re-frame. It's incomplete, and definitely lacking in many areas (documentation being the obvious one), but perhaps somebody will find it useful or want to contribute back. I've personally been using it in some internal apps for a while now.

Re:Using Clojure for Web Apps by mping on Thursday December 12, 2019 @01:40PM (#21774805)
Metosin stuff is really nice too (compojure-api, malli, reitit). And while we are at it, ztellman's aleph and manifold are sweet too.
Re:Using Clojure for Web Apps by jetti on Thursday December 12, 2019 @02:47PM (#21775581)
I really like Figwheel Main (https://figwheel.org/) for live code reloading as well as a REPL for ClojureScript development.
Re:Using Clojure for Web Apps by fnord77 on Thursday December 12, 2019 @10:31PM (#21778948)
yes! We use most of these for a pretty large enterprise webapp.

> It's a pernicious accident of history that we are taught to accept references to mutable objects as normal, inevitable, and desirable in most CS curricula. It is much easier to develop, debug, and maintain immutable data structures instead

Except for trees and graphs and the like. immutability makes working with these much more complicated.

Re:Using Clojure for Web Apps by dominotw on Thursday December 12, 2019 @02:40PM (#21775498)
> desirable in most CS curricula.

most of the alogrithms and datastructures that you learn in CS were developed using mutability.

I am not sure that we can even develop immutable equivalents for most of them with similar time/space complexities.

Re:Using Clojure for Web Apps by lgessler on Thursday December 12, 2019 @04:38PM (#21776809)
Sure, and we could argue about whether mutable code is necessary at systems layers. But at application layers (i.e., the ones most developers work at), cost of development is almost always going to come before performance, and I think it's clear by now that OOP, at least insofar as it has been instantiated by Java, C#, and friends, has not delivered on its promise to simplify application development.
Re:Using Clojure for Web Apps by JBiserkov on Thursday December 12, 2019 @09:01PM (#21778526)
See also this by the same people as re-frame: https://github.com/Day8/re-frame-10x
Re:Using Clojure for Web Apps by subsaharancoder on Thursday December 12, 2019 @02:21PM (#21775292)
I have to echo that Re-frame is superb!!
Re:Using Clojure for Web Apps by psychstudio on Thursday December 12, 2019 @06:58PM (#21777854)
I'll add sente (websockets) and s3-beam (direct upload to s3 from browser) to the list.