Hacker News new | ask | show | jobs
by johannboehme 1367 days ago
Clojure is definitely not dead. There are active Clojure user groups in most countries (even in my little region) and i still (or even more than ever) stumble uppon cool and exiting projects and libs (e.g. https://github.com/borkdude. It's just incredible what a surplus value this dude alone provides to the ecosystem)

Clojure may not have the biggest audience but like others said, it generally focuses more on stability, so using libraries that haven't been updated a while is more of a plus-point and don't mean they are outdated.

Personally speaking, Clojure really brought back the joy of programming and i would never willingly go back to developing in a language without a REPL. The tight feedback loop you have while molding a running program in your editor and the constant dopamine drip feed it causes are just too addictive.

2 comments

"Dead" is a strong word.

Languages that reach the maturity Clojure has never die, they become undying.

There are active Perl groups in some countries. Perl is so undying. Clojure less so, but...

It's a spectrum where Clojure neither has massive adoption (1.51% in SO's 2022 survey [0]) or rapid community growth (compared to hyped or massively adopted technologies).

Clojure is listed as the top paying language in StackOverflow's 2022 survey.

Clojure is an acquired taste. And it isn't a bad one, either!

[0]: https://survey.stackoverflow.co/2022/

> It's just incredible what a surplus value this dude alone provides to the ecosystem)

Seconded; it's pretty jaw-dropping!

> The tight feedback loop you have while molding a running program in your editor and the constant dopamine drip feed it causes are just too addictive.

Well-said -- I've been needing to write some Python recently, and it's only redoubled my preference for Clojure; the Python shell is a poor substitute at best for the Clojure REPL :(

I found it pretty easy to set up a Python REPL in VS Code, which would allow me to do similar things to the Clojure REPL such as highlighting some text in the editor and evaluating. All in all it was pretty close. I guess the only thing that is really different is that it was not connected to the same process I'm debugging, but a different python process. Is that the main thing you're missing?
Yeah, quite different. Technical as much as procedural and psychological.

In a Clojure REPL, you navigate "modules" like directories. And each directory has "files", or vars you've defined. Basically 'cd' and 'ls', but for module-level structures.

So you 'cd' to one "directory", query an AWS service or read a CSV file, and save results in that namespace ("my_namespace/my_results"). While you're at it, you save the results to a JSON file ('echo ... > tests/saved_results.json').

(You type this all into a REPL, no need to save this one-time command in a file. You can always re-run it by pressing UP like in bash.)

Then, you write a function called 'save_to_db()' in your text editor in the "database" namespace that accepts the input and writes to a database. You send that function to the REPL, and in the REPL, run the function on the results you saved from the first step in the var ("database.save_to_db(my_namespace/my_results)".

While you're at it, you 'cd' to your "tests" namespace in the REPL, and write a quick test in your test editor that parses 'tests/saved_results.json' and calls your "save_to_db" function and verifies the database. Send test to REPL (keyboard shortcut), run the test (another keyboard shortcut), fix the code, send updated code to REPL, rinse and repeat.

And this is all in one process, so you only "start up" Java once. Everything else is basically instant.

There's a ton of Youtube videos on using Clojure REPLs. It's really a game changer...

Yeah, that's it exactly. For me there's a power and an ease of flow that comes from having the REPL in the context of your running software, with access to program state and the easy ability to modify your code as it runs without having to restart anything or lose state, that's really unbeatable.