Live data from Hacker News

Why Clojure?

gaiwan.co

71–80 of 302 posts

Re: Why Clojure?

#71
It’s great, and I learned a ton from Rich Hickey, despite not fully grokking Clojure or FP in general. I briefly worked at a small Clojure shop with an extremely talented crew. People were excited about FP and writing real business logic with it. My stack was different there.

The problem started when the honeymoon phase ended, and the codebase grew as the business gained traction. Dynamic typing became a burden, and once the key people moved on, they struggled to hire developers who wanted to write Clojure.

Also, JVM juju shooed many away. After I left, a coworker told me they had started rewriting part of it in Go, and that was going alright. Now, their stack mostly consists of Python for LLM stuff and Go for the main backend. There’s still some Clojure running legacy systems that haven’t yet been migrated over.

Re: Why Clojure?

#72
post #13

I run a multi-million dollar business which I started with common lisp. I since moved away to go and then rust but I've been looking at clojure again lately. For a team that needs to get s** done and has more per employee productivity than Faang combined it's hard to beat the speed with which you can build things when you have the repl and interactive programming. The jvm while doesn't have great error messages is a…

I feel like there’s a minimum developer quality that’s needed when using a language like Clojure, without static typing, and with a wealth of idioms and best practices that need to be followed and libraries that need to be known. Without it it’s a matter of time before the codebase can’t be developed anymore and the software doesn’t work as intended.

You could replace Clojure with Python or Perl, and this Would honestly be even more true.

Re: Why Clojure?

#73
post #59

Earlier quoted context omitted.

There are things in the core language that are still kind of bullshit. The thing that gives me the most headaches is how annoying it is to use Java libraries that have the lambda syntax. You can't just pass in a Clojure `fn` into a Java lambda function. You have to `reify` the interface and implement the single method. It's annoying and verbose and frustratingly the equivalent code is considerably cleaner in Java as…

I think that particular issue was addressed in the recent Clojure release [ https://clojure.org/news/2024/09/05/clojure-1-12-0 ] ("Clojure developers can now invoke Java methods taking functional interfaces by passing functions with matching arity.")

Looks like you're right! I stand corrected, it's admittedly been a few months since I've touched Clojure.

Re: Why Clojure?

#74
post #71

It’s great, and I learned a ton from Rich Hickey, despite not fully grokking Clojure or FP in general. I briefly worked at a small Clojure shop with an extremely talented crew. People were excited about FP and writing real business logic with it. My stack was different there. The problem started when the honeymoon phase ended, and the codebase grew as the business gained traction. Dynamic typing became a burden, and…

I’ve been having a lot of fun messing with clojure, but the dynamic typing really grates on me.

At your clojure job, we’re y’all using spec? I haven’t looked into it yet, and I’m wondering how much it mitigates the annoyances of dynamic types

Re: Why Clojure?

#75
post #61
post #54

Who are these articles for? I feel like Clojure’s value proposition is pretty well understood, and every last Clojure pitch can be relied upon to make the same exact points.

These articles are necessary to counteract armchair critics who are afraid of unfamiliar things and feel insecure. This crowd is loud: you can hear the choir of "but no one is using it, I tried it once and there were parentheses, I tried it and it was too hard, I hate the JVM" — there needs to be a voice that says it works (and works well!) for some people. FWIW, it works for me — I would not have been able to build…

It’s probably geared toward someone like me. JVM and parens are one angle.

Another is that I get paid to work with distributed systems and databases, and Clojure isn’t even part of the discussion in that sphere. Go, Rust, and the usual Python and Node dominate there, so it’s hard for me to care.

However, I dislike language monoculture and am curious about why people like the things I might not care about. This blog is for those.

Re: Why Clojure?

#76
post #71

It’s great, and I learned a ton from Rich Hickey, despite not fully grokking Clojure or FP in general. I briefly worked at a small Clojure shop with an extremely talented crew. People were excited about FP and writing real business logic with it. My stack was different there. The problem started when the honeymoon phase ended, and the codebase grew as the business gained traction. Dynamic typing became a burden, and…

I’ve been having a lot of fun messing with clojure, but the dynamic typing really grates on me. At your clojure job, we’re y’all using spec? I haven’t looked into it yet, and I’m wondering how much it mitigates the annoyances of dynamic types

It was in alpha stage and changing rapidly when they were considering it. But it’s similar to Python’s type hints and isn’t enforced by the compiler. However, that’s better than nothing.

Re: Why Clojure?

#77

Earlier quoted context omitted.

> which you can build things when you have the repl and interactive programming. This is how I use Python to be honest. If I'm unsure of something, I just bust out the REPL.

I know people talk about python being Lisp without brackets, but for example in SBCL and in other lisps like clojure I could just run a larger function, figure out that there is the wrong output, change a tiny function in it, eval that, eval the larger output, get the result. In SBCL there is also the break loop which is just magical. I do not know how you do that in python without using a debugger and stepping throu…

> I know people talk about python being Lisp without brackets

What on earth?? Who are these people, this is the first I've heard of this and am having trouble understanding what the argument could be. Like, basically all languages get transformed to an AST as part of the compile step soooo I guess any language is sort of a lisp.

Re: Why Clojure?

#78

Earlier quoted context omitted.

> There are studies that estimate that the kind of bugs shipped to production that strong static types help prevent account for only 2% of defects. The rest are things like off-by-one errors, design errors, and incorrect logic. If you've got a reference, I'd be interested. (Not saying you're wrong...) > The other thing a static type system can help you with is reading code. But it's primarily an aid to people unfamil…

Or you need a REPL that lets you poke at the living code. It's just different.

I think their point is, even with the REPL, it takes time to track down every spot that function might be called and figure out what was passed to it. A type is very easy to see localized on the function.

Re: Why Clojure?

#79
post #71

It’s great, and I learned a ton from Rich Hickey, despite not fully grokking Clojure or FP in general. I briefly worked at a small Clojure shop with an extremely talented crew. People were excited about FP and writing real business logic with it. My stack was different there. The problem started when the honeymoon phase ended, and the codebase grew as the business gained traction. Dynamic typing became a burden, and…

I’ve been having a lot of fun messing with clojure, but the dynamic typing really grates on me. At your clojure job, we’re y’all using spec? I haven’t looked into it yet, and I’m wondering how much it mitigates the annoyances of dynamic types

I don't think spec with solve issues you are having about dynamic types.

Spec is about asserting structure at domain boundaries; once you're inside a context, it will not do anything.

i.e. If you're connecting stuff together and you want to make sure the state is correct as you pass between contexts -> great!

If you're writing stuff and internally you miss having a strong type system... uh... I don't think it's really going to help you.

Re: Why Clojure?

#80
post #76

Earlier quoted context omitted.

I’ve been having a lot of fun messing with clojure, but the dynamic typing really grates on me. At your clojure job, we’re y’all using spec? I haven’t looked into it yet, and I’m wondering how much it mitigates the annoyances of dynamic types

It was in alpha stage and changing rapidly when they were considering it. But it’s similar to Python’s type hints and isn’t enforced by the compiler. However, that’s better than nothing.

In what way is clojure.spec similar to python's type hints? O_o
Post reply on HN