I hate to say it but Clojure seems like a better language for correctness, because everything is immutable (functional), while in Julia containers aren’t (by default). At least for concurrency, then it claims to be the best language (unlike Julia and Go, it eliminates race conditions, in an easier way than Rust), threading is hard in all languages and Clojure solved it with persistent data structures (PDS), However for parallelism things reverse and Julia is better.
Another reason to use Clojure is “spec”. The idea is that there will no longer ever be (API) breaking changes in libraries. An improvement on SemVer that Julia Pkg depends on, which seemed like a good idea at the time…
I hate the idea that there can’t be just one best language for everything, which is e.g. Rick Hickey’s view, maker of Clojure, and ClojureScipt which is a variant, or my understanding the exact same Lisp, it’s just that ClojureScript is made for the web/JavaScript ecosystem (rather than the JVM). It claims to be best language for web programming (frontend, compiles to JS, can use e.g. React).
Rick doesn’t claim Clojure is best for parallelism, and for it I believe Julia may already be the best language. Julia has a higher/est performance ceiling, since Julia doesn’t box (unless non-concrete types are used, i.e. non-optimized code), while Clojure always does boxing for all types/atoms. There are many similarities between the languages like both good for composition, and both have access to the compiler at runtime, which is a pro, or maybe a con, for compiled binary size… Julia has Lisp-like macros, and then I believe the same “power”, but the macros may feel more natural in Clojure?
I’m thinking of abandoning Julia for a while, to learn more about and immerse myself into Clojure, than I can possibly take ideas back to Julia. Clojure is good for “situated programs”, likely best for it, the type of programming most users are doing while Julia is better for linear algebra (or technical/scientific) if you really need the speed, not my main interest in programming. Neither language is mainstream, Julia likely ahead, the reason isn’t so much that I think it will help get a job (in Iceland) with Clojure, even using either language.
Clojure/Rick claimed to have the largest library system of all languages (at least at the time, from a very old 10-year-old? talk), since it’s based on the JVM, can reuse all Java/JVM libraries (and while not good for security, can also call C, and then other languages including Julia).
I would like to hear the perspective of people that have used both languages (the Julia ecosystem takes a lot from Clojure), know them well (and PDS), e.g. if any abandoned Clojure for some reason. There are older PDS-libraries in Julia (not optimized according to the docs), but also a brand new PDS library in Julia, recently announced here. But even with it, and it being fast (as in Clojure, are they fastest there? Rick aimed for within 2x for reading and 4x for writing such data-structures), that may not be good enough, because you want all data-structures you use to be PDS (for correctness). If Julia had them be default then you could opt out of them for speed (I’m not sure you can in Clojure, but likely you can with the typed Clojure option).
The main other pure functional/PDS language is likely Haskell (statically typed), it’s just harder to learn, and likely not worth it. Clojure is a dynamic language like Julia, and static typing is overrated (as a default)… Any other interesting pure-functional/PDS supporting languages? I had a bias against Lisp (non)syntax, Clojure is likely the best Lisp dialect, and the syntax actually claimed to be the heart of Clojure. I think Julia could in theory get all the best features of Clojure, expect for its syntax…
It doesn’t have to be either or, recently there was a library announced to call from Clojure to Julia (in-process, not sure that’s possible in the other direction, there is JavaCall.jl though, that should work to call Clojure since it has bidirectional interop with Java). There’s also LispSyntax.jl, if you really want the Clojure/Lisp syntax, but I’m more interested in the semantics, and it doesn’t support that.
One other thing, what are people’s subjective feeling about AI tools for Clojure (vs Julia)? ChatGPT didn’t work too well for Julia last time I checked, but it was updated to GPT-4 this week, so that could have changed the game for any minority language. It at least very much improved support for my native Icelandic. Before it could understand it pretty well, but writing it was very flawed, but now it’s almost perfect (according to objective stats it’s now better for it and many language than GPT-3.5 was for English). I don’t think it improved because of a larger fraction of Icelandic in training data. OpenAI is tight-lipped about all details of the training (unlike for earlier versions), but at least the training data ends in September 2021, so I read into that, that it may be the same data, just processed better (for longer).