r/Clojure • • Sep 05 '25

Developing a Space Flight Simulator in Clojure

Thumbnail
wedesoft.de
100 Upvotes

I discovered the Orbiter 2016 simulator in 2017, which inspired me to build my own space flight simulator called sfsim. After early prototypes in C and GNU Guile (for physics and OBJ rendering), I moved to Clojure because of its multi-methods and efficient data structures. I have now been developing a game for nearly five years, appreciating Clojure's immutable values and safe parallelism features.


r/Clojure • • Mar 28 '25

Can jank beat Clojure's error reporting?

Thumbnail
jank-lang.org
100 Upvotes

r/Clojure • • Sep 04 '26

jank reimagines C++ errors and gets an official native package repo

Thumbnail
jank-lang.org
99 Upvotes

r/Clojure • • Jun 06 '25

The next phase of jank's C++ interop

Thumbnail
jank-lang.org
99 Upvotes

r/Clojure • • Aug 02 '21

ClojureScript in the Age of TypeScript — David Nolen

Thumbnail
youtu.be
99 Upvotes

r/Clojure • • Dec 07 '18

Elements of Clojure by Zach Tellman is now finished

Thumbnail
leanpub.com
99 Upvotes

r/Clojure • • Feb 10 '26

The Transducer That Ate Our Heap

98 Upvotes

So there we were, happily streaming 80K-row files through a beautiful transducer pipeline in production. mapcat expanding rows, transduce consuming them one by one, O(1) memory, life is good.

Then the requirements changed: "merge two files row by row." No problem, turns out sequence has a multi-arity that zips collections through a transducer in lockstep. One-liner. Elegant. Passed all tests.

Deployed to prod. OutOfMemoryError. On a 1.5 GB heap. For the same data that worked fine before.

Turns out sequence and transduce don't consume transducers the same way at all. transduce is push-based, elements flow through one at a time, O(1). sequence is pull-based, it uses a TransformerIterator with an internal LinkedList buffer, and when mapcat expands 1 input into 80,000 maps... well, they all land in that buffer at once. Surprise.

I wrote a two-part deep dive about the whole adventure:

Part 1: Elegant Transducer Pipelines — Streaming Large Files in Clojure — The "before" picture. How with-open-xf + mapcat + transduce made a really clean streaming architecture. This is the part where everything works and you feel smart.

Part 2: Merging Two Sources Without Blowing Up Memory, The "oh no" picture. Why sequence betrayed us, what TransformerIterator.step() actually does (it's only 150 lines, go read it, I'll wait), and how IReduceInit + Iterable in a single reify saved the day.
Includes REPL examples so you can blow up your own heap at home.

TL;DR:
eduction + reduce = push = O(1).
sequence + reduce = pull = the LinkedList that ate your heap.
Same transducer, same data, very different outcome.

Anyone else been bitten by this? Or are we the only ones who learned about TransformerIterator the hard way?


r/Clojure • • Jun 22 '23

Leaving Clojure - Feedback for those that care

98 Upvotes

After having written several small projects over the past 9 months I'm leaving this language and want to outline some reasons for that decision such that anyone inclined can work towards bettering this ecosystem.Long post incoming.

The Appeal

In August '22 I spent a month doing haskell after I got a recommendation by a professor.I was also already using emacs since January of that year.I enjoyed functional programming and was just familiar enough with the paradigm as well as the best supported editor to give it a shot.Highlights of the coming months would be the strong support for higher order pipelines through the ->> operator, as well as the well thought out core data structures, especially maps.Another big appeal was the premise of "write clojure everywhere".

On boarding

Initial on boarding with "Clojure for the brave and the true" was fine-ish.Definitely not as great as official resources from other languages such as the official python tutorial, the go tour or the rust book.But at the same time no worse than introductions to comparable languages, such as "Learn you a Haskell"

Going from the first few lines to the first few projects was okay-ish as well.Leiningen was well documented and introduced and libraries for most tasks exist.Some domains have several available libraries with no one bold enough to clearly mark one as the standard.This meant it took me a bit longer than it should to land on hickory for my html parser and cheshire for json, but it's fine in the grand scheme of things.

At some point I wanted to migrate to the official clojure cli.That experience was very rough and I'll go more into some details in the following section, but for now I must cite lack of well written tutorial / walk-through style documentation and lack of coherency.

Project Management

Leiningen is a perfectly reasonable tool. The official clojure cli is not.Every relevant language today just does name build,name run or name install where you replace name with the tool name.Now fasten your seat belts for the official way to run a clojure program: clj -M -m my-code.coreBut let's assume that I want to actually build a jar file, I now have to:

  1. add tools.build to my dependencies

  2. write a whole build.clj file

  3. add an alias to my deps.edn for actually building

Graalvm & babashka

So every once in a while I might want to write a program that doesn't take >1s to start.Both tools are probably about as good as they can reasonably be, given their ecosystem.Both are far from a drop-in replacement.

With babashka it's not too bad. Sure, many libraries aren't supported, but that's to no fault of borkdude. Not much needs to be rewritten and the things that do are not too painful.In an ideal case I wouldn't have to rewrite and could just choose it as my clojure implementation of choice, but it's tolerable.

Graalvm is way more of a mess. It took me weeks of occasional tinkering to get my application (a small cli youtube client) working with graalvm native image. If I hadn't accidentally used an older hickory version it probably would have never worked. I went on to go into the hickory codebase and bisect for the error, and at some point got contribution rights to hickory to upstream those changes. I also documented the issues for the next guy.Terrible experience.

Web Stuff

Clojure is supposed to be the best lisp for the web, the best functional language for the web even.Being able to compile to both the jvm and javascript is a unique trait that no other language I'm aware of has.Yet, after getting motivated to pursue a small web application, I was totally put off.

Descision fatigue everywhere, in fact decision fatigue that is only matched by the incredible churn in the javascript ecosystem. Python has Flask and Django, Elixir has Phoenix, Ruby has Rails, Go has their standard library.Here I'm supposed to pick all the little components myself and end up with 5-6 different libraries that hopefully synergise? No thanks.

And that isn't even the bad part, that's merely a non-strengh. The bad part is the assumed domain knowledge. In clojurescript there are about a dozen react wrappers. None of them prominently link to a good getting started tutorial. It's like the clojurescript guy is supposed to already have extensive experience in js before starting. The backend is only marginally better tbh.

In some hypothetical ideal clojure ecosystem there would be reagent, compojure and a nice, open source book written about each of them.

What to do about it?

Thankfully, there already exists a great talk on the matter that I do agree with: "How to Increase Clojure Awareness" by Artem Bramin at clojureU 2022 (link)
Especially that time to hello world needs to get seriously addressed if this language wants to have any hope of becoming relevant outside the FP niche.

tldr: Clojure is a beautiful language in a horrendous ecosystem. I'm out.


r/Clojure • • Jul 10 '22

CIDER Turns 10

Thumbnail metaredux.com
98 Upvotes

r/Clojure • • Oct 21 '24

Architecture of a full-stack Clojure(Script) application

Post image
97 Upvotes

r/Clojure • • Aug 12 '21

Java language architect Brian Goetz: "Mutability is greatly overused and overrated. Records is a language feature that recognizes the importance of immutability. We want to model data coming in as XML or JSON as ordinary data."

Thumbnail
blogs.oracle.com
97 Upvotes

r/Clojure • • Sep 26 '18

Do not fall into Oracle's Java 11 trap

Thumbnail
blog.joda.org
97 Upvotes

r/Clojure • • Apr 03 '18

What little clojure tricks did you not realize for years?

97 Upvotes

r/Clojure • • Sep 14 '17

I just started learning Clojure, I love it but the documentation is just about the worst thing ever

97 Upvotes

I come from the land of C/C++, Java, Javacript, C#, Python etc...

You'll notice Lisp isn't on that list, I thought it was just a myth up until a little while ago.

So sure enough I started reading about Clojure, and so far so good, honestly the syntax is nice and it's pretty straightforward. I love pure functions and immutability and all that jazz.

But the documentation, Jesus the documentation...

Empires rise and empires fall based on their documentation.

You write a program and don't document it, a few months later it's like your own code is a monster from the abyss.

You build an airplane and you don't document and train people in it, and million dollar giant metal beasts fall from the sky.

You write a programming language and you don't fucking document it, and it'll die. It'll just die.

Let's compare good documentation to Clojure.

Let's say, in Javascript, I want to find the size of an element. I have no idea how to do this, so I Google: "javascript get element size".

If you ignore the stackoverflow spoon feeding, you get this:

https://developer.mozilla.org/en-US/docs/Web/API/CSS_Object_Model/Determining_the_dimensions_of_elements

Look at it. It's beautiful.

Now I know I can, for example, do element.getBoundingClientRect() and I'll get somewhere.

Now let's look at Clojure.

Let's say, I don't know how to get user input. Standard problem for someone new to Clojure, or just programming in general.

So you Google: "clojure get user input".

Once again we'll ignore the stackoverflow spoon feeding, because what happens if stackoverflow hasn't answered it yet? It does happen when you face something that's a little beyond the beginner level.

So we see:

https://clojuredocs.org/clojure.core/read-line

It's a bloody disaster innit?

Let's see what exactly is the problem here.

read-line

(read-line)

Reads the next line from stream that is the current value of in .

(read-line) is how you use it, fair enough, no problems there.

"Reads the next line from stream that is the current value of in ."

You fucking what mate. What is "in"? No link to in, it just says "in".

You google "clojure in" you get nothing of value.

Pretend I don't know what "stream" is, what is this even saying to me?

The one thing that's great are the user examples, but that is also its downfall as I'll show in the next example.

Let's say I'm reading some javascript code. I see this: something.querySelector() and I don't know what querySelector() is. So I google it.

https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector

Look at that. Again, it's beautiful. It doesn't just have one line of documentation, it has a whole page.

Next we're back to Clojure.

And I see this (doseq [somethinghere] (morehere)) and I want to know what doseq is.

https://clojuredocs.org/clojure.core/doseq

(doseq seq-exprs & body)

Repeatedly executes body (presumably for side-effects) with bindings and filtering as provided by "for". Does not retain the head of the sequence. Returns nil.

First of all, sequence-expressions or sequel express or sesquash experiment? The fuck is it? Clojure's constant use of shortened variables / functions etc... is infuriating.

Also if I didn't already know what & does I'd be completely lost there.

Now for the short description of what this thing does:

Repeatedly executes body (presumably for side-effects) with bindings and filtering as provided by "for". Does not retain the head of the sequence. Returns nil.

Presumably for side-effects is it? What if I don't presume, what the fuck does it do then? With bindings and filtering as provided by "for", oh no, not again! For!??! No link to for. Google time.

https://clojuredocs.org/clojure.core/for

Now I've got a whole 'nother set of documentation reading issues and all I wanted was to know what doseq does.

I said before that the examples weren't enough here, this is why:

Look at the first example, the issue here is that I didn't google "how to multiply every x by every y", it's a completely arbitrary problem and solution and really it doesn't explain what doseq actually does, just shows what it could potentially do. These are two separate issues.

I've run out of steam here, point is documentation please. Comments in the code please. Don't shorten your variables from 3 words to 1 letter please.

Keep the "examples" in the documentation, but I think it would be more important to add Related Links and User Explanations, out of all the users at least one or two should be an English teacher, I hope, otherwise we're screwed.

PS: Perhaps the biggest problem is that I can't even imagine how people learnt this language before https://www.braveclojure.com/ was written. The documentation on the main Clojure website I'm sure wasn't written for humans, maybe not by a human either.

PSS: /u/moxaj posted this link down below: https://www.youtube.com/watch?v=nrpsMB2gYI0

It doesn't have as much profanity (surprisingly) but it also says a lot about the state of Clojure's documentation. Honestly it paints an even worse picture than I thought, as soon as anything Clojure-like (is there already something?) but with better documentation comes along, Clojure will basically die. That's my prediction. Unless Clojure can start treating documentation seriously (both internally and externally).


r/Clojure • • Nov 11 '15

Parinfer

Thumbnail
shaunlebron.github.io
97 Upvotes

r/Clojure • • Oct 30 '25

Cljue: Reference ClojureDocs Offline

96 Upvotes

I've been trying to get into Clojure and one pain point was finding a function to do this or that. ClojureDocs has been really helpful, so I wrote this little Babashka script (source) to pull down the ClojureDocs export.json and search over it with fzf and bat.

I'm sure my code is far from idiomatic and I would love suggestions on how this script could be better.

(Also not very familiar with reddit, the image was intended to be a gif (source))

EDIT: Cljue source link above is a permalink to a specific commit (should always work). Here is a link for latest cljue (source)


r/Clojure • • Apr 14 '23

Clojure 1.12.0-alpha2

Thumbnail clojure.org
96 Upvotes

r/Clojure • • Jan 13 '20

"A History of Clojure" accepted to HOPL 4 conference!

Thumbnail
twitter.com
96 Upvotes

r/Clojure • • Apr 27 '25

NuBank named #3 most innovative companies of the world in 2025

Thumbnail fastcompany.com
95 Upvotes

Congrats!


r/Clojure • • Dec 13 '21

Sublime ❤︎ Clojure

Thumbnail
tonsky.me
95 Upvotes

r/Clojure • • Jun 11 '21

Please take a moment to fill out the StackOverflow survey to make sure Clojure devs are represented

Thumbnail stackoverflow.az1.qualtrics.com
95 Upvotes

r/Clojure • • Jun 03 '21

Tour of our 250k line Clojure codebase - Red Planet Labs

Thumbnail
tech.redplanetlabs.com
95 Upvotes

r/Clojure • • Apr 22 '21

CIDER 1.1 ("Plovdiv") is released!

Thumbnail
github.com
95 Upvotes

r/Clojure • • Apr 11 '21

Really excited about this project! It's the first decent wireframing and ux tool I've seen open sourced and it's written in clojure!

Thumbnail
penpot.app
95 Upvotes