Hacker News new | ask | show | jobs
by cube2222 1535 days ago
Slightly OT, but whenever I see Clojure projects I think: "I'd love to write something bigger in Clojure one day, experience it, and see if it's all it was promised to be."

That said, I don't really have any good use case for it right now, whether at work, or among my side projects.

5 comments

I'm a year and change into my job at metabase (metabase.com) writing clojure all day every day and I am still terribly surprised that basically it is all that it's promised to be.

That said, you do need to actually use the repl and be repling all the time because the startup times suck and the stack traces are gigantic all the time. That's pretty much it for complaints. You would expect things that aren't apparent in 30 minutes looking at the language to come up after an entire year, but nothing so far.

Oh wow yeah I forgot about the stack traces. Clojure was the second programming language I ever learned, after self-teaching ruby. lmao ruby does not prepare you for a 700-line stack trace full of java classes you've never even heard of because they're deep in the implementation.

Does it still do that? I remember "better error messages" being a supposedly-coming-soon thing for the couple years I was using it. I eventually got used to it but damn what a hostile experience. In retrospect I'm pretty surprised I stuck with it. For better or worse I don't have that same tolerance & resilience now.

Error messages are much easier to parse now!
(Seems your comment was dead, but I vouched for it as it's contributing to the discussion)

Yeah, with the arrival of clojure.spec, some error messages has indeed gotten easier to both read and parse (for humans and machines alike), although when you use Clojure JVM so still come across the odd huge Java stack-trace (or with ClojureScript, a pretty sizable JavaScript stack-trace).

I did clojure as a hobbyist for years and have only recently taken a job where I'm working full time in Clojure on a large codebase (i.e., first time having to maintain somebody else's Clojure code). It's not a golden hammer by any means, but I'd definitely take it over Java (or Scala) any day.
any experience with rails or django to compare with?
Not to be pedantic but you’re asking for a comparison of language vs. frameworks. Not sure if you’ll get a good answer to that.

That said, I’ve actually used Rails and Django in the past and written a small project in Clojure so I can try.

I actually really love Clojure and had really positive experiences wit Django though I’ve come to favor lighter frameworks like Starlette. Programming in Clojure is quite interesting because it’s functional programming so all the information you need to reason about the function is generally passed in as parameters. It made code comparatively easy to reason about simply by reading the code for the specific function. Clojure also has good support for REPL. I don’t have to do a lot of hunting around for “outside” code to understand what’s going on inside a function. This is the polar opposite of Java, especially when dealing with giant frameworks like Spring, where there is a lot of layers being combined just to do one thing. Coding in Java/Spring, Rails, and even Django can feel a lot like dealing with those nesting dolls.

Like the grandparent, I wish to do more with Clojure some day.

Correct. I like ruby the language. Rails, not so much.
sorry, i also use clojure for hobby projects and am familiar with clojure/repl/etc.

i guess i assumed that since this thread was about web frameworks that their large clojure code base was also a web application. though i see that isn't necessarily implied.

React and ReactNative in Clojure(Script) are amazing if you work in that area. Honestly, I'd never go back to a JS implementation. Reagent [1] provides a seamless interface for components, classes, hooks, etc. and ShadowCljs [2] is a fantastic build tool for the ecosystem. Re-frame [3] is a popular framework in this space.

[1] https://reagent-project.github.io/

[2] https://github.com/thheller/shadow-cljs

[3] https://github.com/day8/re-frame

This is exactly what I just set up! Super cool - coming from doing Redux sagas and hooks and redux and all that stuff on RN it's been really interesting. Would you recommend Shadow vs Krell? I have tried both and so far Shadow was the most seamless, but Krell seems the most lightweight.

If you care to share, i'd love to learn what you are building with it.

I haven't used Krell, but Shadow has been great for me. Been on it a couple years now.

My company is in the smarthome/IOT space and we use React(Native) + Clojure and ClojureScript for all our apps, dashboards, servers, etc.

Same here! I wanted to learn it and Overtone years ago, tried to, realised my brain was just not prepared ;p.

I have a bit of time now and I am diving in again and am more determined this time!

I got clojurescript going with react native, and having fun so far. If you need inspiration check out Rich Hickleys talks. He keeps me going through the hard times!

I definitely recommend messing around with it, even just for a toy, but yeah I'm in a pretty similar boat. Can't think of any specific use case that I don't prefer another language for. On the lookout though!