Some thoughts about Clojure, its latent potential and adoption

Hello, friends!

I have recently picked up Clojure and I’m in the process of getting familiar with the community. I would like to share some thoughts from my entry to this world, and casual conversations I’ve had with “outsiders” along the way.

In the past, my primary programming languages have been Python, Ruby and Elixir. When I ask developers why they like those languages, they often say things like “it’s easy to learn,” “it has such a big ecosystem, with a lot of libraries” and “the community is super welcoming and helpful.” If anyone would have asked me some years ago, I would also have given an answer along those lines.

For lack of a better term, I’ll call that “the effects of branding” the language and its wider ecosystem. “Image” might also be an accurate term. In essence, it’a about people’s thoughts and feelings towards the language. I believe the “brands” of many popular languages can in large part be credited to their creators and early adopters and “influencers.” More than to the actual merits of the languages.

When I ask “outsiders” about their impression of Clojure, they often say things like “it’s an exotic/esoteric language,” “it’s difficult to learn and use,” “yuk, look at all those parentheses!” and “[some other language] has a larger community and more libraries,” amongst other things. That is, unless their response is “never heard of it.” The objections I hear are often shallow and misinformed.

A friend of mine spent a few year gently convincing me to try Clojure. And I’m a programming language enthusiast! I had heard some great things about the language, but it also seemed to have an unappetizing “cult-ish” aspect to it. And hearing the term “Java” put me on the defensive immediately (I did not distinguish between Java and the JVM at the time).

When I finally caved and binge-watched Rich Hickey’s talks on YouTube, everything started making a lot of sense to me.

As a programming language with excellent merits, Clojure can indeed speak for itself. But I feel like we could do a lot more help in “the communication department,” by being smarter about what we communicate and how.

Anyways…

Clojure has so much to offer, and I feel like the message is not reaching a broad enough audience. I feel like a lot of developers out there “don’t know what they don’t know.” Clojure is objectively a much more productive language, especially for “situated systems,” data-driven applications and data science. And one could make the case that it’s actually easier to learn than, say, Python.

And I believe it’s a good thing to have as many users as possible. Because that’s what generates buzz, makes it easier for developers to “sell” it to their companies, etc. When more companies start using Clojure, we’re likely to see an even more vibrant community, more capital investments (like Nubank), more open source libraries, etc. I believe more enthusiastic users and increased adoption is the catalyst for everything else. We should want to get this wonderful tool in the hands of as many craftspeople as possible.

Here are some of the questions I’m thinking about:

  • How can we make more developers aware of Clojure and its strengths?

  • What are the most common misconceptions about Clojure, which are scaring people away?

  • How can we communicate the main benefits of Clojure more effectively, especially when contrasted with other popular languages?

  • What are the main roadblocks for getting more developers to try Clojure?

  • How can we make the “getting started” experience as smooth as possible?

  • What are the main libraries or frameworks (I know, I’m swearing in church…) that people are concerned about?

What do you think?

Keep in mind that I’m still relatively new to Clojure and its community, thus I’m naive to what has happened in the past. Maybe these things have been discussed before; I wouldn’t know. And I imagine the annual “State of Clojure Survey” could reveal some relevant insights.

Side-note: This was originally posted in the Clojurians Slack (#community-development), and spurred the creation of a new channel called #growth. You’re welcome to join the conversation there as well.

10 Likes

Welcome to Clojure,

Better marketing and more buzz would help I’m sure, as it does for most things. That said, I think Clojure, unlike Ruby, Python and Elixir, simply isn’t easy to people, because of how unfamiliar it is.

Python always advertised itself as being an easy scripting language. Ruby on Rails did the same for web dev. And Elixir made Erlang easy.

And you said the first thing people say of those language is: “it’s easy to learn”.

Personally I think that’s a big difference. It kind of is a core principle of Clojure not to favor easy over other things, which makes attracting newcomers on “being easy” a hard sell.

For example, Clojure favors libraries over framework, why? Well libraries are liberating, simple and flexible. You can swap one for another, you are in control, you can choose how to use it and when, individually they’re all relatively small and straightforward, you can understand them and their own code tends to be more approachable, etc. What’s the tradeoff? It’s not as easy. You have to figure out how to organize all the libraries yourself, how to structure the application yourself. You have to figure out how to integrate them together, how to have them interoperate with one another.

I’m saying this because I think that’s one big hurdle. The only languages I can think that got popular without being easy are Rust, Scala and JavaScript, and even here Rust isn’t that popular specifically because it’s not that easy, and I think Scala is losing ground for the same reason. Meanwhile, languages like Go, Python, Ruby, Php, seem to keep growing in popularity, all for being easy.

Can you make Clojure easier without compromising it? I think that’s a good question. We’ve seen some of this happening, having more accessible tooling like VSCode with Calva and Clojure LSP certainly help. Having Babashka helps as well. But I think there’s still a lot of confusion about what’s the easy path to learn Clojure, and what’s the easy mode. If you’re a beginner, where do you start, what do you first build, how do you first go about building things.

And that’s my second thing, I think marketing applications would help, if there were cool programs or websites people used or knew about all in Clojure. If there were more “how to build X” tutorials and videos. That would probably help as well. And unfortunately, I think this also leads to maybe having more frameworks. Not just a tutorial, but like, here, take this framework and just change a few things to create your own version of X easily.

That said, all these I think are chicken and egg. And the chickens that already use Clojure, like me, we’re past easy, we want liberating, flexible, and simple. We want custom tooling, or minimal tooling. We don’t want framework, we want to make our own. And as much as I’d like to make guides and tutorials for how to build X, I’m also more interested in learning even more advanced things for myself.

So this is a bit what I’d worry about if we cranked up the marketing, would we be able to meet the expectations we’ve set in our marketing? Right now, I don’t think we can claim easy, and that right there seem to be enough to turn people off.

So I’m hopeful, but I’m also trying to not get too hyped up that something dramatic could happen and make Clojure blow up. I think it will be a long slow steady climb at best.

P.S.: I think the best thing I’ve seen is recently someone brought up that only from Clojure developers do they ever hear people say they like Clojure because it makes them happy. That no other language seem to have this trend, of people saying their language just brings them joy, fun, pleasure and happiness. So that might be the “image” we could play on?

8 Likes

I think it might have been me who said that I’ve only heard Clojure developers say that it makes them happy.

But I could imagine someone saying, in response, “Great, I like to play–when I have free time–but right now I need to build things. Doesn’t sound like Clojure is what I need now.”

Something that I’ve also said in the past is that part of what makes me happy using Clojure is also part of what makes using Clojure productive. For example, part of what’s fun is how sequence functions work well together, and functions that operate on maps work well together. It makes me happy because it’s easy to figure out how to do a lot … easily. So (once you are in the right mindset) it’s easy to get a lot done pretty quickly. Maybe that should be part of the “makes you happy” pitch.

[Caveat: I don’t go around surveying developers about their well-being, and although I write code as part of my work, I’m not a full-time programmer. Most of my time is devoted to things other than coding.]

4 Likes

I like this a lot. It’s true for me. Clojure makes me happy! Part of what makes me happy about it is that feel productive with it. Over at slack I said something along the lines that I want Clojure to grow so that more people can enjoy their workdays better. Happy and productive. That’s one helluva USP for a programming language!

4 Likes

Hi @Leif, welcome to Clojure and to ClojureVerse!

I can 100% relate to what you are writing. For the most part the Clojure community is a great and friendly place, once you get to know it, but it’s not nearly as welcoming and inviting as it could be. The cultishness is real, and I can completely understand that people find that offputting. There’s quite a bit of arrogance. There’s a small but loud group that tends to dominate a lot of the online spaces, and that are more focused on being right than on listening and helping.

There’s a false dichotomy being perpetuated that making the language easier for beginners makes it worse for pros, while the opposite is true, everyone benefits from better ergonomics. Clojure also isn’t inherently harder to learn than other languages. I’ve run workshops with absolute beginners. It’s a great beginner language, but we sorely lack more beginner-focused materials.

I’ve had conversations about all of these things over the years with many people in this community. Generally I get one of two reactions: relief that they’re not the only ones that experience it this way, or disbelief that someone can feel this way about their precious Clojure community. Some people feel this accutely, others just don’t see it.

I don’t have great solutions. I set up this forum as an alternative space, and tried to make it more welcoming and accessible than some of the other existing spaces. I’m not really sure if I succeeded. I’m now trying it again with the Lambda Island discord. I do hope we can do more, and I know others are thinking about this too.

14 Likes

I think polished, charismatic, interesting videos can go a long way as well. Without a CS or industry background it’s often been people’s audiovisual explanations that help ideas click for me, as much as reading, regardless of the language clojure or otherwise.

It has me thinking, fun clj/s tutorials aren’t a completely scarce niche but there is a lot of room to grow.

My question for others, where do you see largest gaps in (free?) educational content, with regards to attracting and facilitating newcomers? Is it in the very basics, lisps/hosted languages/syntaxes/philosophies? More library specific? Project specific? Users moving from the basics to more advanced applications? More grand scheme, like “I learned the language but want to build X thing?”

If people have valuable input I’ll happily branch this discussion to a new thread

1 Like

I don’t recognize this at all. Could be that I am not picking it up, or that I am not visiting the forrums where this arrogance is manifested. All I see is humble, helpful, and friendly people. (With the odd exception, but that is very rare!)

7 Likes

Lisps have always had a bit of a problem with parentheses. There is massive scope to prune them down to size.

For example, a definition will end in a lot of parentheses. A sequence like ))))) doesn’t contain a great deal of information and could be pruned to something like ). - Also many beginner programs about recursion have (+ n 1) and such, which could be simplified to n++.

The problem of course is that by the time you are good enough at Lisp to fix these problems, you’ve pretty much gotten over the problem. You can break the problem down into smaller functions, eliminate sections with macros, get your editor to match the parentheses for you, etc. I am no longer bothered by parentheses, even though I still find paredit to be a bit of a handful, and to own the truth, often turn it off.

More of a problem is libraries, particularly with Clojure. I want to introduce Clojure to our business, but it is not a exciting prospect dying in a ditch for Clojure when some of the libraries are so bad. To be specific, the problem is the documentation, which starts with some pretty steep assumptions.

I tried the COM bridge library, JACOB, several times before I figured it out. Some of our expensive software uses COM for automation, so that seemed like a good place to start. The solution is that you need to split out the components. The native code goes under one path, and the Java code goes under a different path. The documentation did not explain these things.

I also tried the Python bridge. This was a bad experience. There are at least two of these things, and numerous examples on the internet, all of them wrong. I had to admit defeat.

Now, I have to persuade my boss to use Clojure. Thing is, in a commercial company you want to deliberately keep the number of languages down. And on top of that, I’ve got to tell my boss, with a straight face, that I am confident in my ability to make Clojure work. When there are so many other excellent languages, such as Python and Go, it’s a tall order.

For Clojure to do better the libraries need to be sorted out, with particular emphasis on the documentation.

the biggest roadblock to wider clojure adoption is actually clojure, itself. immutable by default isn’t going to catch on. obviously, there’s a segment of the programming world who prefer it. they’re very much the minority. same for things like the repl. while there is a segment that prefers that approach, they’re the minority.

languages get adopted because of what applications you can write with them, not because of technical details about the language, itself. there isn’t any category of application that clojure is clearly better at than other languages.

the point people made about clojure users saying it makes them happy is quite telling. other languages don’t have that because people use those other languages even if they don’t feel that way. with clojure, if you don’t have the, “wow, this is awesome” reaction, there’s no reason to use it.

this quote, which is about lisp and not clojure, is quite fitting.

"But I think that if you try to ignore the fact that millions of programmers around the world have learned lisp and don’t prefer to use it, you’re in the land of morbid cognitive dissonance.”

clojure had a lot of hype several years ago and a lot of people did try it. the vast majority have chosen not to use it.

It’s worth noting that from the start, Clojure improved some small pieces syntax by reducing the number of required parentheses or changing them to square brackets. That’s true for let and cond, which are inherited from Common Lisp but have cleaner syntax in Clojure. Also, although I’m not as much of a fan of threading macros (->, ->>, etc.) as many people, they do reduce amount of indentation and adjacent parentheses.

The discomfort that some people have with the parentheses is an understandable reaction. I always feel that it should be only an initial hurdle, and in theory it can be overcome by helping someone get comfortable with lisp-style pretty printing (which is different from most languages’), and pointing out that your editing environment can help you see what you’ve actually done with parentheses through indentation and matching.

However, I know that sometimes initial hurdles are the only ones that matter. I don’t fault anyone for that. Time is short, and everyone has to make heuristic decisions about ease of learning, productivity, etc.

I remember reading about an earlier lisp that allowed replacing closing parens with a single bracket or something like that. This would make me uncomfortable, because I would worry that it make it harder for an editor to pretty print code so that I understand what I’ve written. I worry that it would introduce bugs. Thinking about it, I’m not even sure what the syntax would be. Which sequence of open parentheses is the multi-close-parenthesis supposed to match? Hiding closing parentheses in this way might actually scare away people from Clojure, eliciting reactions like mine. People are used to braces and parentheses having to match, after all.

I suppose that in theory someone could invent a parentheses-optional indentation based lisp, inspired by Python. You’d still need parentheses for some purposes. The indentation rules might be pretty tricky, because many levels of function calls are sometimes common in Clojure. (And you need that, because you can’t set up a loop in which you keep changing the value of a single variable at different steps.) I don’t think an indentation-based syntax would be a good idea for Clojure, though, even if it somehow took off. It would mean that the language had two radically different syntaxes, increasing the cognitive load for reading other people’s code. That might drive people way, too.

[Oh, by the way, for (+ n 1), I often use (inc n). Not sure if that’s any better–you could argue that it’s worse since you have to be familiar with inc–but I like it because I don’t have to visually parse the whole expression to see what’s being added to what. inc is in clojure.core. There’s dec, too, for (- n 1).]

One thing I’ve found off putting is when people say there are more Clojure developers than jobs and therefore you’d be lucky to get a job writing Clojure. It strikes me as a bit elitist.

I do not think Clojure is a harder language to sell than any other. But that is because changing a busy persons habits is difficult, and if your company is a consulting firm with customers requesting Angular SPAs, even selling React to your colleagues is going to be difficult. There is an entire chain of people that need convincing. I do believe the way for Clojure to grow is for developers to be so happy using it that they choose to spend time with Clojure, even though it is not what pays their bills. To that end, I think good and well-written blogs, charismatic presentations, etc. are a good way to spread the happy message.

2 Likes

ClojureScript needs to tear down google closure compiler in order to support ES6 modules directly. Without ES6 module support, ClojureScript is broken.

Clojure also suffers from buggy REPL. Especially, nrepl.

Clojure is a great language, but its tools aren’t great.

Lisps have a strength in the parentheses. But, yes, there is sometimes a problem to help people appreciate this strength.

That would kill a lot of the power that the parens have, since then you can’t target an expression from the closing end of it.

1 Like

I’m curious: What are the issues you perceive with the REPL? What needs to be different for it to work better for you?

Interesting point. It’s true Clojure itself doesn’t have that many libraries, but I tend to just consider all Java libraries to be Clojure libraries. Have you tried that route? Just use the Java libs directly, there are a lot of them and a lot with pretty decent documentation.

I agree here, but I would say it’s not the immutable by default, it’s the unergonomic fallback to mutable and imperative. Most people try Clojure by going through leetcode like questions, and not having imperative loops, obvious ways to mutate vectors or arrays, those are immediate roadblocks.

That’s very true. It just makes me sad that of the people I’ve seen try Clojure and not find joy in it, they also tend to not find joy in any other languages. I guess they find their joy more on the outcome itself, they’re happy they made a cool application, the journey doesn’t really matter as to how it was made and with what tools.

This is the truth as well. If Clojure found itself in a place where you had to use it to accomplish something, it would blow up. If it became the official language of a popular platform, the only way to script a popular application or framework, etc. That’s how almost all others got popular, C had Unix, ObjectiveC and Swift had iOS/macOS, JavaScript had browsers, Python had Linux and now ML, PHP had web servers, Ruby had Rails, C# had Windows, Kotlin has Android, etc.

The other group of popular languages are just evolution of existing popular languages, Typescript as an improved JavaScript, C++ as an improved C, Scala as an improved Java, etc.

The one I can’t explain exactly is Java, not sure how that got popular. I feel Java killed Lisp in a way, because I think the Virtual Machine Garbage Collected concept of Java is what made it popular at the time, but that was Lisps pioneering most of it back then, yet Java came in as a similar runtime but with C-like syntax, it was free and open source, and it also could run in browsers with applets. I think that explains Java’s rise.

Now I also want to say Python and Go have had Google, it’s not exactly a platform, but there’s always been this draw that what Google uses programmers want to use too.

This is the genius of Clojure as well for me though, it seems to recognize that, and so it adopted a parasitic design, so it doesn’t need to be popular to be viable, since it could piggy back on others like Java and JavaScript.

That’s a non trivial amount of work, and without Google Closure advanced compilation, it be hard to get bundle size under control. That said, ES6 module support is slowly getting added and being made less and less cumbersome: ClojureScript - JavaScript Modules (Alpha)

3 Likes

I think that’s all correct, but I’d add that when Java came out, C++ considered was the (or a) premier language for business. It was the safe choice. But Java was a simpler, less bug-prone C++ that was developed and promoted by a big corporation, Sun. It’s not just that it had C-style syntax, but that it had serious OO features that were reminiscent of C++. In addition, as didibus’s last remark suggests, it was promoted as the language that was going to make the web as interactive as desktop apps. There was a lot of excitement about that point, which was heavily promoted. (It’s sort of ironic that what ultimately took over that role was the not-really-Java-like language retrofitted with a name to suggest it was like Java in order to take advantage of Java’s popularity.)

Someone else said nREPL crashes, but I don’t use nREPL.

This has not been my experience at all - I’ve found the nREPL/Clojure REPL to be one of the most stable parts of my system. In fact, I can’t think of any time that the nREPL server has crashed, and it is probably the most long running user process on my computer.

4 Likes

I’ve never seen nREPL crash. And I use it. Extensively.

3 Likes