7 ms·
What do most here use Clojure for? For me, there was little value in using it over nodejs for single server CRUD apps with postgres. Some things I liked are nam
by romero-jk 5y ago
What do most here use Clojure for? For me, there was little value in using it over nodejs for single server CRUD apps with postgres. Some things I liked are namespace keywords, REPl integrated with your editor, immutability. But still, it felt like swimming against the current. Immutability is not as useful in a single-threaded event-loop like nodejs. No third party SDKs, even though I know Java using the Java SDKs was tedious labor, most Clojure wrappers are pretty bad too, so more interop.
- dgb23 5y agoYou can use Clojure on Nodejs too. I personally can’t use it for production code. But whenever I automate something or write some prototype I use Clojure. Iterations are faster, more direct, less of a hassle. There has also been someone commenting around here that they use it as an network repl to poke around running production systems, which I find an interesting use case.
- carbonguy 5y agoI've been a Clojure hobbyist for many years, and these are a few of the things I've done repeatedly: - Scrape webpages with http-kit and Specter - Visualizations with Quil - Serve static pages with Ring, Compojure, and Hiccup (un)Fortunately, I don't write Clojure professionally, so I can get away with liking it for aesthetic reasons as much as anything. It definitely does feel like swimming against the current sometimes, though - one runs into bus factor issues a lot in the Clojure ecosystem. But hell, I love it all the same :) Personally, I am really excited for Clerk - this looks like a really useful tool and I'm looking forward to trying it out!
- ReleaseCandidat 5y ago> What do most here use Clojure for? That's to evade having to use Java, Scala or Kotlin. Clojurescript: because it's the easiest (compared to Elm, Purescript and Rescript) to call JS.
- knubie 5y ago> Immutability is not as useful in a single-threaded event-loop like nodejs. Concurrency is not the only, or even primary, benefit of immutability in software. State and state management is the number one driver of complexity in software, and complexity itself is the number one problem that makes building software hard. [0] > For me, there was little value in using it over nodejs for single server CRUD apps with postgres. You can use clojure on nodejs with the value that clojure is a much, much better language than javascript. [0] http://curtclifton.net/papers/MoseleyMarks06a.pdf http://curtclifton.net/papers/MoseleyMarks06a.pdf
- romero-jk 5y agoI was referring to Clojure's immutable data structures, not immutability in general. My nodejs apps are just transformations pipelines of pure functions with postgres being my global mutable state. Clojure doesn't offer me anything here that I can't easily do with JS/node. Sure Clojure is a better language but not better enough to justify the additional abstraction layer IMO.
- phyrex 5y agoIf you're using pure functions then you'd likely profit from clojure's data structures, as they're much cheaper to copy and modify than javascript's native structures. Of course you could use something like ImmutableJS or Immer, but then you're putting yourself at odds with the rest of the JS ecosystem and built-in functions and you have to transform values back and forth. This gets a lot easier with Clojure(script) (even though there's obviously still some casting back and forth when you're going outside the CLJs ecosystem)
- didibus 5y ago> Sure Clojure is a better language but not better enough to justify the additional abstraction layer IMO Speaks for yourself, I'd take a pay cut to be able to use Clojure over JS (don't tell anyone ) Some of the why that is is captured here: https://gist.github.com/didibus/6e5ff960b25fdc1a5f8f97acede614b0 https://gist.github.com/didibus/6e5ff960b25fdc1a5f8f97acede6... But understand that a lot of it is about what language you personally enjoy and prefer, Clojure makes programming 10x more fun for me, and I already am someone who finds programming in general fun.
- didibus 5y agoI use it for everything. Professionally, I write backend services (mix of micro-services and bigger SOA ones) of various types. Some command lines, some scripts, a few web apps. In my spare time I use it for random things, mostly stuff I mess on, personal scripts, doing programming challenges, websites, data exploration, etc. You can use Clojure with NodeJS as well using ClojureScript by the way, or NBB if you want something more straightforward for writing NodeJS scripts.
- fulafel 5y agoIt's a good default app dev language for web backend and frontend projects at work, and attracts good programmers to the team(s). Immutability benefits are first and foremost about semantics in most cases.