News for hackers. Stuff that matters.
Re:Clojure Web Development Evolved [video] by janetacarr on Friday July 29, 2022 @11:47PM (#32284109)
Another attempt at the Rails for Clojure. Great. The web stacks (yes stacks, there are many at this point) are very mature. I'm getting tired of seeing people re-inventing the wheel over and over again.

I love Clojure, but this language is going to die off if people don't start putting more effort into building mundane, everyday libraries. (I know I am). Clojure has high velocity, but it's always offset by having to create new libraries or update rotting ones.

I've noticed a ton of software rot in what were once major Clojure libraries, like Onyx and Cortex, now fading into obsolescence.

I'm sorry, but I will keep bitching about this on HN until people help me.

Re:Clojure Web Development Evolved [video] by heretoo on Saturday July 30, 2022 @01:36AM (#32284521)
I feel your frustration. Clojure, in my opinion, has always been niche, but is still effective and may actually be immortal? New things are always being tried by small groups of people leaving corpses strewn about.

I don't think it is the building, so much as the burying that needs more work, so that we know what libraries do or don't need tombstones.

To the best of my knowledge, Onyx and Cortex were both backed by companies which either needed to move onto more successful products, or in the case of Cortex, they closed up shop. It might be better to look at libraries that have stronger community support.

Onyx is an amazing library but it competes with other libraries like KafkaStreams which has community buy in, and commercial support if needed.

Cortex might be replaced with mxnet which got clojure bindings sometime in the last couple of years (see gigasquid). (Although libpython might make this redundant -- assuming language purity isn't a blocker to being pragmatic).

Others will have better examples, but here are some simple ones that are well maintained, but lets not forget that the java ecosystem is also available:

clojure clojurescript core.async mxnet integrant

Its good to remember that what might be considered "rot" in some ecosystems, is just a sign of maturity and of a library being finished. Many older libraries with no commits in years function as is, as documented.

Re:Clojure Web Development Evolved [video] by rufius on Saturday July 30, 2022 @09:24AM (#32286607)
> Its good to remember that what might be considered "rot" in some ecosystems, is just a sign of maturity and of a library being finished. Many older libraries with no commits in years function as is, as documented.

I’ve noticed that pattern in the lisps and Erlang. Things are dead, they just don’t really need any changes.

Re:Clojure Web Development Evolved [video] by dimovich on Saturday July 30, 2022 @08:26AM (#32286251)
Yes, and if I may add a few more libraries that are actively maintained, with wonderful documentation and great functionalitY -- next.jdbc for SQL, Timbre for logging, Sente for websockets, Reitit for routing, Carmene for Redis, re-frame for frontend state management, Datascript for frontend DB, and many more.
Re:Clojure Web Development Evolved [video] by didibus on Saturday July 30, 2022 @03:57PM (#32289761)
I think Onyx and Cortex always were redundant. You have Kafka and Spark/SparkML and Storm, you can use them from Clojure without problems.

If Onyx had been the first, it could have become what Spark is, possibly.

My point being, I don't really think every language needs a distributed compute, just need one and have bindings from your language to use it. Clojure being Java has access to many bindings for many of those popular libraries.

Re:Clojure Web Development Evolved [video] by dimitar on Saturday July 30, 2022 @02:35AM (#32284807)
Clojure libraries are good but you have Java and JS interop for mundane, everyday libraries. Is there anything wrong with interop?

I think most Clojure libraries rightfully focus on things that either only possible or needed in Clojure. Things like core async, typed clojure are not even possible to implement in other languages as libraries.

When thinking of examples: the cognitect/aws-api is amazing in it's ease and fun, yet AWS Java SDK is also easy to use from clojure. I prefer the former, but there isn't anything wrong with the latter.

Re:Clojure Web Development Evolved [video] by janetacarr on Saturday July 30, 2022 @09:23AM (#32286596)
As someone alluded to, Interop can be frustrating with big frameworks.

Interop also relies heavily on reflection, and may require type hinting once it becomes a performance problem. Interop also implies the use of side-effects since we're relying on Java object. While a lot of Clojure's sequence and collection operations do work on Java sequences and Collections, it's not perfect and very easy to get bitten, requiring a Clojure.walk/postwalk and zipmap with coercion to get a good Java->Clojure container/sequence/collection.

If we used interop for everything mundane, Clojure would really just be an S-expression shaped husk over Java code. Not a very great solution imho.

Re:Clojure Web Development Evolved [video] by didibus on Saturday July 30, 2022 @04:08PM (#32289839)
I'll politely disagree. The mundane libraries I think you're talking about tend to be about IO, that's always going to be side-effectful in nature. Their APIs wouldn't be all that different even if implemented directly in Clojure.

Type hinting isn't hard or time consuming, literally you can take 10min and have everything type hinted.

Now I don't know about big frameworks, maybe I don't find a need for big frameworks? But even then, what kind of framework are you talking about? Using Spring MVC for example?

Re:Clojure Web Development Evolved [video] by regularfry on Saturday July 30, 2022 @05:12AM (#32285392)
A problem I have run into (admittedly, having not written as much clojure code as I'd like) is that some java libraries in particular can make interop distinctly unpleasant. Anything around the Spring framework, for instance, made me tear my hair out. Yes it's possible, but by the time you've compensated for the impedance mismatch you might as well have done a rewrite.
Re:Clojure Web Development Evolved [video] by didibus on Saturday July 30, 2022 @04:11PM (#32289855)
Hum, I've used Spring with Clojure a lot, never had issues.

Things that are difficult to interop are java annotations based stuff, having to implement interfaces or subclass classes, and functional interfaces.

But you can use Spring without annotations, which is my preferred way anyways, because I favor explicit over implicit.

Re:Clojure Web Development Evolved [video] by john2x on Saturday July 30, 2022 @05:10AM (#32285383)
If you're using interop for mundane, everyday things, why use Clojure then? I imagine you would end up writing non-idiomatic Clojure code to do the interop (e.g. working with mutable objects and not immutable datastructures).
Re:Clojure Web Development Evolved [video] by didibus on Saturday July 30, 2022 @04:17PM (#32289904)
The recommended design for Clojure programs is imperative shell, functional core. You use Clojure as your functional core, and it interops with mundane libraries for the imperative shell, such as database clients, http clients, logging, http server, graphics, sound, etc.

It works beautifully, and the REPL helps with all of it.

Re:Clojure Web Development Evolved [video] by jayceedenton on Saturday July 30, 2022 @09:57AM (#32286861)
I've been in the Clojure world for over 10 years but I don't really recognise the problem you're calling out here. There will always be libraries in an ecosystem that lack maintainers, particularly if they did not see the hoped adoption or an alternative de facto solution has emerged.

Many Clojure libraries are conceptually simple and solve one problem well, so it's common for them to reach 'feature completeness' and not see much activity after that. clj-commons has also ensures the active future of many libraries.

A friend and I adopted a library we felt was stagnating and still had lots of useful features to add. I don't see this more in Clojure than anywhere else though.

Any more examples that need engineers? Onyx always seemed to be entering a crowded space.

Re:Clojure Web Development Evolved [video] by hewrin10 on Saturday July 30, 2022 @12:03AM (#32284184)
What kind of mundane libraries don't exist? And do you mind sharing what you are working on?
Re:Clojure Web Development Evolved [video] by Barrin92 on Saturday July 30, 2022 @01:07AM (#32284421)
not the OP but this struck home for me because I just recently worked with Clojure and I was surprised that there was no standard library to deal with filepath operations. Having to use Java's nio, immediately exposed some weirdnesses, like having to pass an empty array to Paths.get() because just calling it with a string with one parameter made it chose the wrong overloaded function.
Re:Clojure Web Development Evolved [video] by jhhh on Saturday July 30, 2022 @01:36AM (#32284523)
Vararg support in interop and type creation (deftype/defprotocol) seems like a reasonable ask.
Re:Clojure Web Development Evolved [video] by lenkite on Saturday July 30, 2022 @01:48PM (#32288765)
Re:Clojure Web Development Evolved [video] by didibus on Saturday July 30, 2022 @04:37PM (#32290049)
You can type hint to pick the one of the type you're looking for. It's not any weirder than in Java, no need to pass an empty array.
Re:Clojure Web Development Evolved [video] by janetacarr on Saturday July 30, 2022 @09:14AM (#32286534)
Yeah. I've just started on a couple things, and it's slow going because I have contract work and burgeoning Clojure blog. However, I'm working on a stripe API library that is up to date, and a syslog server library.

It's these API-wrapping and protocol-handling type libraries that either are way out of date, or just don't exist.

Re:Clojure Web Development Evolved [video] by yayitswei on Saturday July 30, 2022 @02:34AM (#32284802)
For better or for worse, this is the lisp curse at work.
Re:Clojure Web Development Evolved [video] by tmountain on Saturday July 30, 2022 @09:41AM (#32286750)
I was doing a lot of data science with Clojure a few years back (gorilla repl). I looked up incanter, and the last commit was in 2020. I was surprised, as this space is so well suited for Clojure’s strengths. How does a robust library essentially end up abandoned?
Re:Clojure Web Development Evolved [video] by mtnygard on Saturday July 30, 2022 @10:16AM (#32286976)
It happens the way anything else gets abandoned… not enough contributors. Many of the libraries mentioned in the comments here were created by one person. When that person loses interest (or gets a new job!) the library goes stagnant.

It’s kind of a tragic irony. Clojure gives a solo dev enough leverage to create such a library. But because it only needs one dev to create it, the bus number stays at 1.

Re:Clojure Web Development Evolved [video] by tmountain on Saturday July 30, 2022 @01:48PM (#32288762)
This would make sense, but the project has 98 lifetime contributors and 298 forks.
Re:Clojure Web Development Evolved [video] by didibus on Saturday July 30, 2022 @02:19PM (#32289030)
What mondane library are you missing? Everything I need is there, so I'm curious what people are waiting for?
Re:Clojure Web Development Evolved [video] by Diris on Saturday July 30, 2022 @05:15AM (#32285405)
That sounds like a blog post you could submit to get more visibility :)
Re:Clojure Web Development Evolved [video] by janetacarr on Saturday July 30, 2022 @09:10AM (#32286500)
I write a lot about Clojure, but I haven't written about this specifically.

I'll start today.

Re:Clojure Web Development Evolved [video] by janetacarr on Saturday July 30, 2022 @12:57PM (#32288297)
If you're still interested, I wrote the post and submitted it here https://news.ycombinator.com/item?id=32288291