![]() |
|
![]() |
| Does anyone remember Groovy? It has @Grab annotation which does essentially the same as add-libs you described. Very conventient for writing scripts. |
![]() |
| Just tested it:
You run `clj` to get a Clojure REPL Then you can for instance paste the following into the REPL
- the first line downloads a library and adds it to the running session- the second and third line add the library to the REPL's default namespace - the rest of the code makes an axis and plots some random values - the output is then serialized and send out the REPL output You should get a little SVG plot on the output PS: Make sure you have version `1.12` by running with `clj --version`. If not, then (re)run the instructions here to get the latest version: https://clojure.org/guides/install_clojure |
![]() |
| Parent specified a RC version, does it automatically use the latest RC versions as well? AFAIK, it only uses the latest stable version, but I could be wrong, it happened before. |
![]() |
| Such a pleasure to get a boatload of new features and all my code just runs on it because of the hard work dedicated to avoid breaking changes. |
![]() |
| The functional interface changes are huge. Clojure is always at its best when staying close to Java via judicious use of interop and this solves one of the major missing links. |
![]() |
| It continues to exist and is in use. Lots of work has been done on a successor, but that is stalled while we consider what we want to do on various things. |
![]() |
| Clojure's slow, deliberate development pace confuses people. The core team takes backwards compatibility very seriously. What you see with each new Clojure release is generally improved performance, better Java interop, and a smattering of new features. This is doubly true for 1.12 which is doing quite a bit of invisible work to make interop considerably better.
So what you don't see is a constant flux of "innovation" followed by a community having to adapt to those innovations. People pull Clojure examples out of books that are 12 or more years old and they still run. I think there's some very exciting things in the Clojure space, such as Clerk (https://github.com/nextjournal/clerk) for live notebooks, and Babashka (https://github.com/borkdude/babashka) for amazing (and amazingly fast) scripting. |
![]() |
| I don’t do much Clojure anymore (I wish I did!) but agreed on all points. The JVM interop is such a huge, huge advantage that it’s hard to express to people who aren’t used it. |
![]() |
| Electric looks outstanding. It seems like the sort of thing that would take some time to spread but once it does and people take the time to learn it it could be huge. |
![]() |
| > I found myself frustrated a lot when I used it two years ago.
Sad to hear about your experience. > A lot of abandoned libraries. There's not a huge ecosystem around it compared to golang I found it to be the opposite. In Clojure you have Clojurists Together: https://www.clojuriststogether.org which funds people to work on Open Source libraries. And more importantly there is Clojure Commons: https://github.com/clj-commons which takes popular Clojure libraries, that are no longer being supported and carries on looking after them. When I found popular Go libraries that have been abandoned, I asked in the Go community, if there are such initiatives, especially seeing how Google is behind Go. When people didn't understand what I meant, I pointed them at the examples above, from Clojure. To which their response was "TIL, Clojure, never heard of it before! No, we don't have such initiatives in Go." Maybe the initiatives from Clojure Commons & Clojurists Together need more visibility for the newcomers to Clojure? |
![]() |
| Exactly.
Find a random node package that was last changed 4 years ago and it might as well be toxic waste. Find a clj lib with the same stats and it's probably going to work smoothly. |
![]() |
| The really nice thing about Clojure is it runs on the JVM.
The entire ecosystem could die tomorrow, and you can still compile new Clojure code for any system that supports Java in the future. |
![]() |
| Dumb question: what is clojure usually used for ? (in my view, Java is for "enterprise" stuff, python for AI/data sciences, C for performance, etc.) |
![]() |
| I've been at an organization that went from Java to Clojure about 12 years ago. I think there were two main things that allowed us to make the move:
* No one was in love with Java. It was fine but we were doing the whole spring style super verbose Java and it felt like a lot of ceremony to get anything done. There had been an experiment with Scala previously but that hadn't taken off. * We had a service-oriented architecture which meant we could try Clojure out on a few new services and see how it felt. We ended up going from 2 services to moving the whole org over really quickly. A lot of excitement built up and people didn't want to be left out. At the end of things only 2 people decided they didn't want to learn Clojure. A few other things we did: * Bought loads of books and left them lying around * Started a Clojure club where we booked an hour a week and did some exercises in Clojure * Had a big meeting where we convinced everyone that Clojure was worth an experiment * Brought in 3 consultants to do some Clojure training for everyone * Probably strong armed everyone into watching simple made easy - it helped that lots of people had already seen it live that year There are a few talks about it floating around although they are very very old now and I'm not sure they're worth the time! https://whostolebenfrog.github.io/clojure,/deployments,/clou... |
![]() |
| > Does any of this release help with startup time?
Clojure (and indirectly Java) was never created with "fast startup speed" in mind. This is why things like `add-lib` (that was added in this release) is so useful, because you start your developing session once, and it stays open until you either have to restart your computer or done developing the project. Then the typical deployment target is either "Push this .jar to a server somehow, start the process and let it run" or "User double-clicks executable, waits for application to be ready". If you really need fast startup, you can go through something like https://github.com/ionutbalosin/faster-jvm-start-up-techniqu... Or if you're fine with slightly worse runtime performance, give https://github.com/babashka/babashka a try Finally, if you're OK with JavaScript you could give ClojureScript a try, has fast startup (as fast as NodeJS I suppose) but yeah, it's JavaScript. But overall, Clojure/Java isn't optimized for the use-case of "Start process for each request, stop process once processed" so I'm guessing you'll face an uphill battle there. |
My personal favorite is add-libs
You can now write single file demos or minimal examples for issues. Really lowers the friction to share small runnable snippets with people
You can also actually use it to demo Java libraries as well without all the Java boilerplate. Just poke around in the REPL and paste code into a comment on HN or wherever and anyone can replicate your "setup" and get it running exactly the same. No need to clone a repo or anything