logoalt Hacker News

coolThingsFirsttoday at 11:11 AM3 repliesview on HN

Is this lang for web dev?


Replies

embedding-shapetoday at 11:17 AM

Yes, web development is a pleasure with Clojure.

On the backend side, you start your server once, and whenever you change it locally, you apply what you changed directly to the running process, so you don't lose any state and without having to restart the server at all, so iterating on the program becomes very easy. Bugs are easy to track down too, as you can evaluate parts ("forms") of the program inside the process itself, debugging becomes a breeze.

On the frontend side, you have ClojureScript that basically enables the same but in a browser environment. Usually I have the browser on the right, my editor on the left, and whenever I "evaluate a function", it runs in the browser context, so again same thing; the frontend keeps the same state even after your changes, so no more "make change -> wait for compilation -> get frontend into the state that reproduces the issue -> output debug info -> make change again", you just change one part, see the page update and then continue changing.

If you've used React+Redux (or similar) before, it's basically that experience, but much tighter and together with code evaluation inside of the browser context. If I recall correctly, Redux was pretty much directly inspired by ClojureScript and Reagent in the first place, I think Abramov even referenced ClojureScritp/Reagent in the first Redux talk.

midnight_eclairtoday at 1:57 PM

clojure itself is a joy to use, on the web or outside of it

BUT

it doesn't have the equivalent of rails, mostly because lispers are an opinionated bunch and can't come together to agree on how web development should be done

the frameworks that do exist are more of a collections of libraries with some plumbing to connect the dots

show 2 replies
emoIItoday at 11:17 AM

Yes, as ClojureScript