Some thoughts about Clojure, its latent potential and adoption

I wonder about the distinction between “teaching someone new to programming how to do it using Clojure (e.g., Clojure for the Brave and True, ClojureBridge workshops, etc.) and successfully communicating the advantages of Clojure’s particular design choices and tradeoffs to someone who already has “seen the elephant” and spends at least some of their professional time shipping working software.

In the educational case, I think Clojure does pretty well; bandwidth to on-board new programmers and of course, finding places for them to get paid to apply that new knowledge, remains a challenge. I don’t think that “there’s more Clojurists than Clojure jobs” is either always true, or meant to be elitist; it’s just a common fact of the industry landscape that folks should be aware of.

In the second case, the lack of a Rails-y “just run this command in a terminal and you Have An App” platform certainly raises the bar for working professionals who might spend a weekend afternoon test-driving a new thing to see if it’s worth exploring further, but of course the preference for composing tools and libraries for a given use case is also (rightly, in my opinion) touted as one of the strengths of the Clojure paradigm.

Another quirk of the Clojure ecosystem that I’ve seen trip people up is that libraries, even widely-used ones that are perhaps “the default” for their use case, can sit on some 0.x.y version with no new releases for years, not because they are abandoned, but because they are complete. This is entirely alien to the way of being espoused in other language/platform communities and can seem off-putting, but again, in my view is much better than constantly adding new features in order to maintain social relevance.

My personal suspicion is that, as mentioned upthread, languages Get Big when there’s a new application for languages with coattails ready to ride to mass adoption among folks looking to do that new thing. Clojure didn’t have coattails to ride, and so even though it’s subjectively a much better way to approach many different domains that other languages used to Get Big, Clojure remains something of a backwater.

Clojure is a delight to work in, and the combination of Clojure and Datomic let my colleagues and I punch well above our weight as a tiny team, and for me that is enough. I’m happy I get to work with it, and as the occasion arises I’m happy to tell others about how the language helps me do more, faster, than I could working in Javascript or Swift or C#, etc., but I’m not losing any sleep over the fact that Clojure hasn’t “won” one of the races to the top of “The Only Language for thing Mountain”.

8 Likes

There’s a lot of things I like in Clojure. Apart from its community and technical features, it’s a REPL driven development, syntax & code navigation but it all takes time to appreciate these things. There’s no one to show newcomers how it affects their workflow and how to set it up. I’m primary Vim user and learning Emacs itself was a huge commitment for me. Add learning to use REPL with your text editor, all these extensions that makes working with Lisp easy etc. to it and you get steep learning curve. I remember how I was exploring Clojure and Lisp in general and I had to find out all these things like paredit, rainbow parentheses by myself before frustration took me over.

Learning other languages, even the ones that are considered hard like Rust for example, means you just need to learn the language itself and maybe some basic building tools like package manager and compiler. In Clojure you need to learn language, working with REPL, working with parens, choose between deps, Leiningen or Boot + ShadowCLJS/Figwheel for ClojureScript, building app etc. Some of these concepts can be hard if you haven’t heard of them before (and you probably haven’t because Clojure/Lisp is kind of exotic at these aspects) and don’t know where to start (and you probably don’t because even official website of Clojure suggests not widely used editor not updated since 2019).

So IMHO there’s a gap in easy batteries-included tools for beginners or tutorial what they need to make their working with Clojure better.

Pertain to marketing I think there’s some unused potential - it’s a metaprogramming. E.g. Svelte is a new tool for building web applications that gets a lot of attention. Technically it’s rather compiler than a framework that takes Svelte code which is basically bunch of HTML, CSS & JS and produces efficient JS code that reacts to every change of variable and updates only these small parts of DOM where the variable is being used without any techniques like Virtual DOM. Unfortunately it’s very limited and enforces you to write code in specific way. I believe it’s way more trivial to implement it in ClojureScript using macros, atoms and Hiccup syntax and it’d be default way to make frontends in ClojureScript if not React.

2 Likes

In some ways, I think this is something that also makes it harder for Clojure to “Get Big”: you can do more with less. At work, we have just two Clojure developers and 123K lines of code. Our prior legacy codebase was larger than that and did a lot less and we needed more developers to manage it.

Anyone can open issues about clojure.org content at Issues · clojure/clojure-site (github.com) and if you’ve electronically signed the CLA, you can submit Pull requests · clojure/clojure-site (github.com) to help update the site. It’s hard for the core team to track everything going on in the community (and I think this entire REPL series was contributed by the community in the first place).

I think for most people coming into Clojure, VS Code + Calva is the easiest on-ramp now – and it has all sorts of interactive beginner material around it – and that wasn’t true even just a couple of years ago.

4 Likes

Just some rambling thoughts..

I love software histories because of how much decision making, arbitrary and intentional, has been crammed into a century alone .. Which has swept up, killed off, constantly evolved as many cultures as anything civil.

What I remember seeing about the promotion of Java without living through its timeline is how it was pushed as the big platform-agnostic, platform.

However it seems Java came before the rise of major virtual machines that properly emulated others, modern browsing, web ubiquity, even mobile devices. Portability certainly wouldn’t have the wow factor to embed itself in industry now.
/
Clojure, Scala etc have theoretically its same scope, which gives them the hosted language advantage, well described as

In Clojure’s original marketing push, I wonder what in particular has been emphasized or de-emphasized now that isn’t frequently discussed anymore.


It’s interesting to witness a community surrounding a language which is mature but whose origins haven’t reached levels in computer history of ancient folklore.

Where has the “story of clojure” been told?

I found the big picture difficult to grasp coming to clojure, and it was subsequently easy to get lost in the forest among the trees. I think the ability to cohere and describe its evolution is an underrated selling point, as strong as editors or build workflows. If I hadn’t arrived through SICP and old Lisp papers, I think I would be questioning the apparent obtuseness of FP, REPLs all that (even in the mountain’s face of devotee blog posts).

A History of Clojure perhaps?

3 Likes

I would say the multi-core future hasn’t happened. At first I saw a lot of Clojure marketing around being able to write multi-core application with its support for STM (software transactional memory) that promised to enabled bug free multi-core code. And it was being said that because Moore’s law reached its limits, multi-core was going to be how we scale beyond it.

I’d say this didn’t pan out yet. CPUs haven’t really continued to add more and more cores. You’ll find 8 core to still be the norm. And in practice, STM hasn’t really been that useful for most people finding they don’t really need it. Finally even when using it or writing parallel multi-core implementations, it seems the speed ups bottleneck quickly around something, maybe the GC, maybe the memory bandwidth, maybe the cache misses, it’s hard to pin-point, but there seems to be limits to speed ups through multi-core parallelization.

1 Like

That’s very interesting. Didn’t know it. I remember that kind of talk.

fwiw, there have been times when I love pmap, pcalls, etc. Just add a “p” to “map”, and suddenly it’s 6X faster! This is a clear benefit of Clojure, from my point of view. (You do have to organize code so as to bundle as much computation as possible into functions that don’t require interaction between bits of data that are mapped over.) But the stuff I write is somewhat atypical in the Clojure world.

I think giving talks at non-Clojure-specific development conferences can help, with maybe some emphasis on comparisons with other languages.

Some people might still feel it’s more of a “fun” or “hobby” language and not suitable for building real applications. I think more publicity in the broader development community about products and tools built with Clojure (and why they were built with Clojure vs other languages), would be helpful.

@PEZ has done a great job with the Getting Started experience that Calva provides.

Continuing to improve tooling to reduce friction for newcomers is of course really important. I also think more published video content of Clojure workflows would be great. It’s a great format for showing people the power of a good Clojure workflow in any given editor.

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

this is hard, Developers are a hard headed lot. I actually would of never looked at Clojure until about a decade ago, I ran into it at a massive Health software company I was working for. I was turned off initially by the language. The idea of “side effects” (I was relatively new to Functional Programming) was a new notion for me. I didn’t have any previous experience with LISP and I had always avoided Emacs because of it.

I think what sold me on the language was the first time I realized I could write a robust GUI app (using SeeSaw) in about 25 lines of code. One of the things that keeps me coming back to Clojure is the interoperability with Java and Java libraries. For instance, Haskell took awhile (may still be in progress?) to get ported to Apple’s M1 Architecture. there was a JVM available within a month of the release of Apple’s M1 (I just found out Oracle’s JVM now supports M1).

Another advantage to Clojure is that, being hosted on the JVM/js, you get performance optimizations for free. for example, you get access to Metal on Mac OS and DirectX on Windows transparently for things like 2D rendering, etc. There’s also a myriad of code optimizations you get by being on the JVM.

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

I think what scares people away is that they think Clojure is purely functional instead of mostly functional.

Clojure is very pragmatic where it counts. You can override immutability if you need it. You can use Object oriented concepts over functional ones if needed.

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

Well, the same way that I was sold on it. Show the amount of code needed for a basic app in Clojure vs Python/Ruby/Whatever.

Some of where Clojure really shines are advanced features that take awhile to work up to for most programmers. For instance, things like Atoms, and concurrency Agents/refs.

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

Perception, for sure. Programmers who have had bad experiences with LISPs or other functional languages aren’t going to be excited to try it. The appearance of being esoteric doesn’t help.

Polish prefix notation is new to a lot of newbie Clojurians. However, when you think about it, it makes sense in a functional point of view. Example seeing (+ 3 3) looks odd compared to var x= 3+3

But when you think about it, Addition is a function being applied to it’s operands, in this case, both 3s.

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

This is my personal opinion here, but I think focusing on Leiningen as the initial build tool is helpfull. if you are totally new, I’d recommend learning Clojure/ClojureScript before trying to go full stack and using Datomic as well. Datomic is an amazing database, but I feel it has a specific use cases where it is clearly a superior technology. For instance, it address time automatically as a meta-data element of stored Datoms in the database. It’s very cool to be able to get the exact state of your database at anypoint in time.

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

I’d like to see some more focus on ML/AI frameworks.

I think Clojure is probably one of the most innovative technologies that I’ve seen mature during my career. I love the technology. What I’d like to see is Cognitect, the company behind Clojure and derived technologies, focus more on growing their business and becoming a more powerful player in the software world. For example, MUMPs is equally esoteric and based on an old idea, yet it’s mopping up the healthcare industry with Vendors like Epic, Meditech, etc. using some variation of it. There’s no reason Clojure can’t explode and become a very popular language.

3 Likes

One of the things I like about Clojure and that makes it easier in comparison to other languages (even other lisp) is that there is a single api for all collections (maps, vectors, lists). I think this is something to sell to begginners like me: You do not have to learn/search for a set of methods each for Lists, Maps, Queues… just like in Java or Scala.

1 Like

Firstly I have lost count of the number of times I’ve had this conversation and I wish we could come up with the ‘killer feature’ or ‘chasm jumping marketing strategy’ to promote Clojure better but I’ve not seen that lightbulb moment yet.

I’ve come to the opinion that the qualities of Clojure that push me to use it are the same qualities that restrain its adoption. It’s data first, libraries over frameworks, functional approach enables you to ‘discover’ the business landscape through sensing data flows and then evolve your software to meet new demands or better understood constraints.

However, most developers and almost all business stakeholders don’t understand that business problems are never fully understood, can’t be fully predicted and that releasing software changes the ecosystem, requiring new changes. It takes a certain level of experience and an open mind to accept that you can’t control everything (much?) and that your ‘building materials’ need to support rapid adaptation and enable sensing the direction change should take.

So this leaves Clojure with a small subset of developers/businesses that understand this and accept it. That subset is quite small, you have to understand that an alien-looking language that forces you to think differently is worth the initial pain to pay off over time.

7 Likes

One thing I think that has impacted Clojure’s popularity in recent years is that a lot of languages have adopted the more palatable aspects of Clojure. You can do very functional programming in C#, they have async methods, immutable collections, defrecord, data literals, metaprogramming, dynamic typing, lambdas, first-class functions and a whole host of other features. Likewise you see the same crop up in Rust, Swift, Elixir, Kotlin, etc. These languages offer a “gateway drug” or a “opt-in” culture to the value propositions of Clojure. In other words, they allow you to keep writing code in familiar ways, while still reaping the benefits of functional programming.

Something else I never considered until I recently watched a talk with John Carmack is the power of drop-in replacement for developers. What are the chances that a person from one Clojure company can be dropped into the codebase of another Clojure company and sit down and say “yeah, this all makes sense”. In my experience that is very rare. There are so many different views of macros, wrapper libraries, web libraries, and tech stacks, that in general when I see a new code base I have to ask “do these people like transducers? do they shun spec? do they go whole-hog on async?” And I have to adapt my mental model of programming to that codebase.

The contrast to this is some other languages that are either too limited to have much variance across codebases (C, Go, etc.) or have very strict rules about what is “right” and so it’s a bit easier to step in and be the replacement for someone.

So anyways, that’s my two cents, I think the value proposition of Clojure has been eroded over the years by other languages being “good enough”, and companies are hesitant to choose the “best” language if that means cutting their workforce to a small percent of what it otherwise would be.

11 Likes

So I am at the point now where I can’t see myself really using another language for large stuff anymore. And luckily I don’t have to (for the foreseeable future).

Clojure is just that good. I gave up on selling it though, unless one genuinely asks me, and then I won’t stop talking :slight_smile:

I was a freelance programmer and I just introduced Clojure in multiple green field solo dev projects (some of which now grow and employ extra developers). The last of which is a now economically profitable bootstrapped SaaS company I founded, where I can spend my full time on. And if that grows more, I’ll be hiring Clojure devs too. So in a way that ‘marketing strategy for clojure’ worked out to some extent: there’s more clojure code bases than there were before :slight_smile:

Now: I am nowhere near the best engineer in the world, but I get the job done, and my code is generally well maintainable, so I am happy. (I made horrible things before my clojure time, on the maintainability spectrum, in Java, PHP, etc).

BTW: What I liked a lot is how easy it was to onboard other Clojure developers into a Clojure code base. Getting to learn other people’s code bases is way way less complex in Clojure than in most typed languages where people define their own ‘DSL’s’ all the time by class hierarchies and what not.

But how to REALLY market all that? No idea. No time either.

But it’s an absolute bliss when speaking to other people who also ‘get’ clojure. Because then there’s no need for convincing all the time.

So I leave with a shout out to @plexus: thanks for creating this forum! :clap:

6 Likes

From my experience, this applies more to people like me, where if I lose the fight to have a team use Clojure, I console myself by using some of the functional features in C#, Java 17, Scala, etc.

I’ve rarely seen the other way around, in that those features just go unused for the most part, and if I’m showing people Clojure I’m always surprised that trying to relate it to functional features in other languages often fails, cause they have no idea what I’m talking about haha.

C# and Kotlin I’ve found has the most “gateway drug”, in that it seems those communities seem to do a better job at having people actually use a bit of functional programming. Surprisingly Scala I’ve found does poorly, not sure how people use scala, but it seems they just bang it until it compiles not really knowing what it’s actually doing.

Anyways, the two aspects in my teaching Clojure to devs that I’ve found they struggle most is the lack of a standard for loop, early return, and how to model state and structure code, like a simple I don’t understand how I would have a User and do things with that.

And a bit of getting used to the syntax and visual noise from parenthesis.

And for that, C#, Kotlin, Java, even with newer functional features they added, it doesn’t help, because people still don’t know how not to use a for loop, or how not to use early return, or how to model state and behavior.

5 Likes

I love your observation about the two completely different points of view regarding “for loop, early return, and how to model state” – that’s very insightful.

I think it depends on the Scala code you’ve been exposed to. In my experience, there are two very different schools of Scala usage: the “better Java” crowd and the “almost Haskell” crowd. Or at least that was my experience when I was deep in the Scala community ('09-'11) before I switched to Clojure. I thought that the “better Java” usage would probably die out and a lot of those folk would switch back to Java… but maybe the percentage of the “almost Haskell” crowd just remained very low, based on what you’re saying you’ve seen?

1 Like

Definitely take it all as anecdotal, but I’d say at my company it’s very much “a better Java”.

I think when Scala is introduced in a team, there might be one or two initial devs who are interested in its functional and Haskell-esque aspects. But the rest of their team will just use it as “a better Java”. And eventually when those initial one or two leave the team, others will replace them also just using Scala as “a better Java”.

So eventually, you’ve got way more devs using Scala “as a better Java” and never really trying to learn FP or the deep intricacies and concepts of Scala.

I also think Scala is not chosen for new things as often since Kotlin came around.

So probably when I get someone from a prior Scala team, and teach them Clojure, they’re more likely to be of the “I just used it like a better Java”.

Also, a lot of people’s use of Scala sometimes is more minimal, having used it for Spark.

I’m sure there’s some team where everyone is more into Scala as a better Haskell, but probably I never got someone from a team like that.

I’ve wondered too if Scala obfuscates FP too much. Sometimes all the type related complexities and the existence of classes can obfuscate the essence of FP, like the fundamentals. Not sure if that’s true, but I had that thought.

Where are the available books or courses that are for complete beginers to programming? Clojure is loosing potential users by only having resources for people already experienced with programming.

2 Likes

What about academia? I cry sometimes at the things new grads have been taught. Any signs of Clojure being used to teach methods in university courses? Perhaps again marketing to academic conferences would help?

I had thought part of the idea of the Nubank purchase of Cognitech was to boost conferences and community building - to sensibly safeguard their own investments in the language. But I haven’t been aware of any great impact, albeit there’s been a pandemic in the meantime.

I’m fairly confident that when people say “python is easy”, what they are really talking about the application of it towards a specific task NOT the programming language itself. They mean, for example, someone wrote a very specific guide in python.

You can’t fix that with branding.

I wish i could offer a solution!

2 Likes

I’m dropping in after learning the languages originally 3 years ago. It feels like very little has changed in those 3 years?

I like the language a lot and reach for it when I don’t want to deal with the computing archeology of having to run a traditional LISP/Scheme. What’s most off-putting to me is all the non-language stuff:

  • The VScode integration, the one I tried didn’t work (GitHub ticket) so I ended back up at Calva which kinda works but it’s always difficult to figure out which of the options you need (9 options when starting a REPL).
  • The REPL itself is very messy and can’t figure out whether it’s a REPL or an editor. I have to manually eval things or not? REPLs are praised as the magical thing but never could get them to work in a way I would consider nice and was told to watch an hour long screencast (nonstarter). Example: I Alt-Enter an expression and it then prints the output in a totally unrelated place. Shouldn’t these two things belong together?
  • Five ways of doing anything, lein, deps, don’t know anymore. Exacerbated by the split between Clojure and Clojurescript which makes it 10 ways to do anything.

What I’m looking at mostly (I main python):

  • Rust: cargo test; cargo run; One way of doing things. Just works. You can do really weird things with a Rust project and swap things out but I need to read some advanced books to figure that out. Nobody talks about it.
  • Roc: charming evolution of Elm/Haskell that maybe will get some stuff right, but too experimental and small to be used for anything at the moment
  • Javascript/Typescript: I like to hate on this a lot but playing around with small languages, the benefits that a large language has in terms of resources, documentation etc. becomes all the more evident. Also 10 ways to do anything but if I choose to live within this or that framework, things mostly work.