Live data from Hacker News

Ask HN: Is Clojure Dead?

news.ycombinator.com

141–145 of 145 posts

Re: Ask HN: Is Clojure Dead?

#141

Earlier quoted context omitted.

> 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 subst…

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...

Re: Ask HN: Is Clojure Dead?

#142
post #8

I am learning Clojure right now and I can relate to the feeling of not wanting to put time and effort into it if there is no marketable value in return. One thing that is motivating me is I read an article about how niche languages can be lucrative. (I want to say that article was here on HN but too lazy right now to search for it). The other thing that is motivating me is that this type of programming and thinking i…

Funny, I was just looking for a PT clojure dev.

Re: Ask HN: Is Clojure Dead?

#143
post #140

Earlier quoted context omitted.

Is Java supposed to be the best or the worst here? comparing oneself to the worst is not a good look… I’d rather Clojure have a nice open tracker system you can submit issues/PRs to instantly (without preapproval) like most Github/Gitea-hosted OSS projects do.

It's an open source project, the benefit of being a bit closed down is that you can then focus on coding instead of scrolling through issues/PR all day. Who wants to do that?

Open source was invented to make the barrier to contribution easier. Putting up a barrier is therefore counterproductive. By your logic, just force everyone to fork their own copy if they want to make changes, so no one has to scroll through PRs/issues.

And they wonder why no one has solved the curse of lisp?

Re: Ask HN: Is Clojure Dead?

#144
post #79

Earlier quoted context omitted.

REPL driven development is great, but there are still tons of situations where you want a full recompile and restart. Slow compile and start time really slow down development. Recently I was porting a small application from Clojure to Rust, and 'cargo watch -x run' was faster than 'clojure.tools.namespace.repl/refresh' and is more reliable.

> Recently I was porting a small application from Clojure to Rust, and 'cargo watch -x run' was faster than 'clojure.tools.namespace.repl/refresh' and is more reliable I think this tells me we differ greatly in our development approach. Because it seems you still practice a kind of traditional TDD. I'm not saying one is better, but I think this is either a personal preference of style, or maybe you haven't tried the…

I've worked with Clojure for years using the REPL driven approach and found I needed restarts quite often, for example when adding updating dependencies or other changes to the project file.

REPL driven development is great, but sometime you want to make sure that you are not using some function that was only defined in the REPL session but not in the source code. Also the REPL session sometime gets in a bad state when printing big outputs, blocking forever with some concurrency stuff or other mistakes.

Re: Ask HN: Is Clojure Dead?

#145
post #35

Clojure is a wonderful language, but not so wonderful that I can tolerate its slow startup and compile times. I think lots of developers think the same way. Imo any language nit facilitating fast startup and compile is stillborn. Imo the same goes for any language requiring you to setup a "project" or something to get started.

Yeah, Clojure is not great for CLIs, but pretty much every other use case it excels at. For CLIs, there is always Babashka ( https://babashka.org/ ) which works good enough. For local development, you usually just compile+eval one function at a time as you change them, and those happens under 1ms, not enough to even notice (unless you develop with a remote REPL, but then network is to blame) For server usage, you usu…

I think it's more of a problem in combination with serverless cloud computing.
Post reply on HN