8 ms·
Clojure 1.12.0 is now available
- tgerdin 2y agoLooks like a pretty solid release, very happy that Clojure is still going strong!
- haolez 2y agoIs it going strong? I'm evaluating it for a new project. I'm considering it together with Clara[0]. However, it does give a vibe that it's not as mainstream as it was before and that the ecosystem is more sparse than what is once was. I'm not trying to troll. I want to choose it. It seems like a good engineering decision to me, but if it's nosediving in popularity and contributors, this might bite me back in the near future. [0] https://www.clara-rules.org/ https://www.clara-rules.org/
- hlship 2y agoClojure'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 https://github.com/nextjournal/clerk) for live notebooks, and Babashka (https://github.com/borkdude/babashka https://github.com/borkdude/babashka) for amazing (and amazingly fast) scripting.
- ReleaseCandidat 2y agoI guess that the GP didn't talk about the language itself, but the users. For me it looks like Scala and Clojure had lost many of its users because of Kotlin and newer Java versions. Generally I see a decline in the usage of functional languages since their heyday in the 2010s. I guess that's because imperative languages either get "functional features" or are "functional enough" - new ones like Rust or Swift.
- ndr 2y agoClojure is more lindy than Scala. If someone tells you their project is written in Scala, Golang, Groovy, Coffeescript it almost dates the project doesn't it? Not so much in Clojure. It's niche but I can bet it's still going to be there 10 years from now, going at least as strongly as now.
- uDontKnowMe 2y agoI'm not so sure. I wish it were as you say but there are currently 5600 job postings mentioning Scala on LinkedIn in the USA, vs 82 that mention Clojure. 82! In the entire USA. So even in its state of relative decline, Scala might be about 70 times as used in industry as Clojure is. Even as I flip through the 7 postings mentioning Clojure in all of Canada, only 4 of them seem to indicate the job itself makes use of the language (rather than mentioning it just as an example language as in "* Fluency in one or more languages like Ruby, Clojure, Scala, ReactJS, JavaScript, TypeScript, Java, Python - Deep understanding of internet protocols and standards.")
- erichocean 2y agoWhat Clojure dev uses LinkedIn to find jobs? I certainly wouldn't.
- Barrin92 2y agoFrom the last view developer surveys I've paid attention to it didn't seem like Clojure was growing much but it's definitely still large enough of an ecosystem to be a valid choice. So, depends on your definition of 'going strong'. On its merits it's definitely still a great choice, I never really thought of it as particularly mainstream.
- jmcgough 2y agoI found myself frustrated a lot when I used it two years ago. A lot of abandoned libraries. There's not a huge ecosystem around it compared to golang and other popular languages, but there's probably enough that it's a viable option if you really want to work with the language.
- gleenn 2y agoI think there is this misconception that lack of activity on libraries indicates they aren't worth using. But I strongly believe a lot of libraries are just feature complete and bug-free enough to leave them be. The syntax of the language changes so minimally that libraries don't have to change at all after updates. This isn't Javascript where everyone keeps tweaking things over and over again.
- mark_l_watson 2y agoI agree, solid working libraries often don’t need frequent updates. Sort of Common Lisp: a lot of old very stable code that just works fine.
- jacobobryant 2y agoAlso the whole/part of the point of being hosted on the JVM is if there isn't a clojure lib for something you can just use a Java lib.
- regularfry 2y agoThe problem this creates is that as a potential consumer I can't tell the difference between "effectively done" and "abandoned, half-done, and about to waste a lot of my time". I don't see an easy answer to this because having "done" be an available state is extremely attractive, and forcing extra work on the author would be the wrong thing to do.
- gleenn 2y agoWell, picking libraries shouldn't be done willy nilly by looking at the stars in a github repo or that they contributed 5 minutes ago. There are many curated resources that help pick libraries. Here is a great one: https://www.clojure-toolbox.com/ https://www.clojure-toolbox.com/
- jakebasile 2y agoI'd categorize Clojure as stable but niche. It's not nosediving in popularity, but I don't think it's growing by leaps and bounds either. Many libraries are also stable, in the sense that they are finished - sometimes people will see no activity on a GitHub project and assume it is dead when in reality it's just done. Clojure libraries tend to be very small and focused, and often no Clojure wrapper is needed at all due to the ease of Java interop. I love Clojure, and it's been great for me and all the professional teams I've worked on that use it.
- thom 2y agoWhat you’re seeing sounds familiar but definitely not new. I’ve used Clojure professionally for 15 years and at no point in that time have you been guaranteed critical mass around any library or framework. Clojure has always been a small ecosystem of high variance people and projects. You get things like Rama and Electric which are bold reimaginings of what systems could look like, but you also get a lot of short lived, burnt out efforts that fizzled. The good news is nothing really _breaks_ ever, and you have access to the entire JVM ecosystem if you want it (many Clojure people find Java interop icky which I personally find moronic).
- asa400 2y agoI 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.
- eduction 2y agoElectric 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.
- pjmlp 2y agoIronically, Clojure seems to be the only guest language on the JVM where the community is welcoming of the platform that makes their existence possible in first place. Similarly to how Groovy used to be, but I am not counting it as it seems only to be around to power Gradle and little else. Scala and Kotlin folks speak too much about replacing Java, yet I am yet to see their native variants match JVM in any form or fashion. Even if we take Android into consideration, Google was forced to update their Java support, as means to keep Java libraries ecosystem available for Android developers and their beloved Kotlin.
- aeonik 2y agoThe 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.
- deleted 2y ago[deleted]
- souenzzo 2y agoReagent is the clojurescript wrapper to react Reagent has the same API and the same best practices since 2014 Meanwhile, react changed from creactClass to extend Class. From classes to function components. Many clojure libraries are simply done. There is no reason to commit everyday to a project.
- rr808 2y agoIts dead in the water. Sure, some people like it for their private projects and I'm sure there are some commercial products but I wouldn't touch it. I dont particularly like Scala either but at least it has Spark which means it'll be around for decades.
- fire_lake 2y agoScala for spark is in decline too - people prefer the Python bindings for some reason.
- geokon 2y agoI'd also look at https://github.com/oakes/odoyle-rules/ https://github.com/oakes/odoyle-rules/ I think the userbase is slowly shrinking, but I'd personally use Clojure even if all Clojure developers disappeared tomorrow. It's not built on shifting sand as the JVM is stable. If you need really niche/cutting edge stuff you're probably going to need to dip into Java or JS interop anyway
- filoeleven 2y agoThanks for the link! I’m not the parent poster, but I was thinking of using Clara Rules for prototyping a game idea and to get some experience with rule engines. I don’t think that truth maintenance (which is handled by Clara and not O’Doyle) is important for my use case, and O’Doyle looks simpler to pick up.
- jiehong 2y agoNuBank[0] mainly use clojure for most of their software, and NuBank is a big yet quickly growing company. [0]: https://en.wikipedia.org/wiki/Nubank https://en.wikipedia.org/wiki/Nubank
- mvc 2y agoThere's another Clojure rules library worth considering. It has a section in the README about why you might prefer it to Clara. https://github.com/oakes/odoyle-rules https://github.com/oakes/odoyle-rules
- jdminhbg 2y agoSuch 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.
- diggan 2y agoLovely to see add-libs and sync-deps, aren't many (any?) reasons to close down a session at all now. This release feels like it had a very different scope from previous releases, contains a lot of stuff, which is exciting to see! But I hope it doesn't end up like a hairball a few releases down from increase of pace or something.
- eduction 2y agoPure speculation but I believe this is the first release since Rich Hickey left nubank so could be more attention from him.
- simongray 2y agoThey've also hired Michael Fogus to work on Clojure, so more resources are definitely being put into developing the language.
- _xiaz 2y ago> But I hope it doesn't end up like a hairball a few releases down from increase of pace or something. Rich Hickey and the rest of the Clojure Team are very careful designers. I wouldn't worry too much
- diggan 2y ago> Rich Hickey and the rest of the Clojure Team are very careful designers. I wouldn't worry too much I am aware of this, which is why I suppose previous releases haven't included as many features at once as this one. It's this possible change of pace that raised the question in me :)
- tvaughan 2y agoAdd to which, a lot of "new, big features" come in libraries, not the core language itself.
- 2y ago
- charlotte-fyi 2y agoThe 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.
- ledgerdev 2y agoWhat had become of spec? Abandoned? Any news on hopes for it?
- puredanger 2y agoIt 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.
- ledgerdev 2y agoIt would be wonderful if perhaps the clojure team could do blog posts on those various things, perhaps might bring ideas to come from elsewhere.
- contrarian1234 2y agoThis is really a massive release with many cool new features 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
- fire_lake 2y agoCool! You should post an example :)
- geokon 2y agoJust tested it: You run `clj` to get a Clojure REPL Then you can for instance paste the following into the REPL (add-libs {'thi.ng/geom {:mvn/version "1.0.0-RC4"}}) (use 'thi.ng.geom.viz.core) (use 'thi.ng.geom.svg.core) (->> {:x-axis (linear-axis {:domain [-10 310] :range [50 550] :major 100 :minor 50 :pos 150}) :y-axis (linear-axis {:domain [0 4] :range [50 150] :visible false}) :data [{:values [[0 100] [10 90] [80 200] [250 300] [150 170] [110 120] [210 280] [180 280] [160 240] [160 170]] :attribs {:stroke-width "10px" :stroke-linecap "round" :stroke "#0af"} :layout svg-stacked-interval-plot}]} (svg-plot2d-cartesian) (svg {:width 600 :height 200}) (serialize) symbol) - 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 https://clojure.org/guides/install_clojure
- 2y ago
- koito17 2y agoI thought they were going to hold this until Clojure/conj 2024. No particular reason to believe so (besides Clojure 1.10 being released around the same time as Clojure/conj 2021 and the Datomic-becoming-free announcement being done at the very start of Clojure/conj 2023). Still waiting on spec2, though... for now I am working around rigidity of specs by using Malli but it really isn't a first-class citizen in Clojure (mostly due to inability to check macros, and this is by design of the Clojure compiler). But you can emulate the ideas of schema/select by manipulating malli schemas as data. The changes for functional interfaces also means we no longer have to maintain utility macros like (defmacro ->Consumer [f] `(reify java.util.function.Consumer (accept [this arg#] (~f arg#)))) and instead just pass functions directly.
- eduction 2y agoWhat do you mean by “inability to check macros”? You can s/fdef macros with spec and it checks the calls at compile time. In fact Clojure core uses spec to check macro calls as you can see in the stack trace sometimes when you call one wrong. Do you mean something else?
- koito17 2y agoHere's what I mean by Malli's inability to check macros. https://github.com/clojure/clojure/blob/ad54fec/src/jvm/clojure/lang/Compiler.java#L7520 https://github.com/clojure/clojure/blob/ad54fec/src/jvm/cloj... The Clojure compiler directly calls into clojure.spec and does not expose any sort of hook for validating macros. No library can validate macros except clojure.spec. In this sense, Malli feels like a second-class citizen in Clojure compared to the built-in clojure.spec.
- eduction 2y agoAh thanks for explaining! I did not know they special cased spec. I hope that changes.
- doubleg 2y agoI really wanted schema/select after watching “maybe not”, so wrote a library for malli: https://github.com/eval/malli-select https://github.com/eval/malli-select
- MarkMarine 2y agoThis is a wonderful language I've only just started paying attention to, watching the talks from Rich on YouTube have ruined things I loved (like Either types.) I'm struggling with how to introduce it into my company without recommending my colleagues follow my path of working through 3 books and then watching most of the conj talks from the last 12 years on 1.75x speed, while building a personal project and re-implementing a couple of services I work with every day in it... but the lessons around simplicity I think are so critical, I'm going to find a way.
- chii 2y agoFind the least important project that one person can take on, and have that be the prototype for the clojure stack. Ideally, use someone well versed in the tech stack - otherwise, you're taking on double risk of a new tech stack plus unfamiliarity. This prototype needs to demonstrate the value of the clojure stack - which has to have a business value (aka, speed/ease of maintenance etc). Convince the decision makers to use clojure after the above prototype showed value, and use it to extrapolate value for other projects. This will then require a transition from doing the project, to teaching others (who might not know clojure at all). You cannot rely on just telling people to watch videos or read books - they won't do it, and it will cause failure in subsequent projects. You will have to hand hold, until the newbie "clicks". Unfortuantely, this is an uphill battle, because management will always want to hire for the "regular/normal" tech stack, and will have trouble finding clojure-ready people. So the company will continue to have to invest in teaching it to new hires, which is a drain that could tank the clojure move.
- lelag 2y agoHonestly, maybe don’t. You love Clojure, that’s awesome. But introducing it at your company if it does not have a lisp culture already might not go so well. You say so yourself: lisp dialects like Clojure come with a steep learning curve, and not everyone will appreciate the shift, especially if they're comfortable with the current stack. Forcing it on your team could create frustration, confusion, and a lot of resentment, not just toward the language, but possibly toward you. Sure, you might convert a person or two, but most will likely see it as unnecessary complexity. If you really want to write Clojure every day, you might be better off finding a company that already embraces it instead of trying to turn your current team into Clojurists. Sometimes it’s better to enjoy something for yourself than to make it everyone else’s problem.
- lincpa 2y ago[dead]
- pjmlp 2y agoLots of cool improvements. The main Lisp like language I usually reach for.
- xxmarkuski 2y agoClojure is great. Brining together Lisp with the Java ecosystem makeand its concurrency model makes it great for building backend system, while still enabling quick changes. One thing that I found noteworthy is that Clujure did not pickup some innovations happening at Java since like version 8, such as Invoke Dynamic in the JVM or streams.
- puredanger 2y agoGenerally for streams, the equivalent in Clojure with sequences or transducers is much cleaner and simpler so there was not a lot of reason to want them from Clojure. However, it is important to provide interop paths to work with Java libs that make use of them. The functional interface coercion is implemented with invokedynamic.
- kunley 2y agosync-deps and add-lib seems very cool
- minikomi 2y agoFantastic. Sure would love to get a clojure job one day.
- deleted 2y ago[deleted]
- wiz21c 2y agoDumb question: what is clojure usually used for ? (in my view, Java is for "enterprise" stuff, python for AI/data sciences, C for performance, etc.)
- rockyj 2y agoIt is a general programming language (with great interop with Java). You can pretty much build anything with it - web apps (backend + frontend), APIs, Scripts, etc. Anything you can do in Python / Java you can do it in Cloujure. It even has libraries for data crunching (or can use Java libs).
- uludag 2y ago"Enterprise" stuff in a much less "enterprise" way is one usage, hence being based off the JVM. Rich Hickey has also mentioned the concept of "situational programs"[1] which Clojure is used in a lot. Clojure is also used in a wide variety of other areas like data science[2] or desktop applications[3] much like other general purpose programming languages. [1] https://youtu.be/2V1FtfBDsLU?feature=shared&t=639 https://youtu.be/2V1FtfBDsLU?feature=shared&t=639 [2] https://scicloj.github.io/ https://scicloj.github.io/ [3] https://github.com/HumbleUI/HumbleUI https://github.com/HumbleUI/HumbleUI
- ebiester 2y agoThe same advantages of java in a lisp-like shell. NuBank, OneStudyTeam, CircleCI, and Guaranteed Rate are some of the larger companies I know about personally that have significant investments in Clojure.
- sir_eliah 2y agoA lot of banking/finance use cases.
- zcam 2y agoExoscale, a cloud provider is also using clojure heavily. Pretty much anywhere where the jvm is a good fit, but given it’s a hosted language you can also use it to emit dart code or js and find it running on shoulders of others (like jank, llvm based dialect, or babashka)
- anothername12 2y agoWe had to dump a Clojure code base for Golang because it was too slow for lambda usage. Does any of this release help with startup time?
- diggan 2y ago> 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-techniques 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 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.
- souenzzo 2y agoNo changes from clojure. But from java world: With GraalVM/NativeImage, it is possible to compile (clojure or java) .jar files into native binaries. Those binaries have a way faster to startup (less than 10ms for non-trivial apps) Also, lambda engines (like AWS lambda) continuously improve their "java" target, with preloading and other things,which also benefits clojure. TLDR; clojure startup isn't a thing that needs to be fixed. JVM startup used to be slow. And this is being resolved in the JVM itself. Note: clojure DEV startup time is still slow-ish. Clojure DEV is usually not AOT compiled and etc. the new "sync deps" feature helps to solve this DEV problem
- puredanger 2y agoIf you're interested in learning more about Clojure, check out the Clojure/conj conference Oct 23-25 in Alexandria, VA. https://2024.clojure-conj.org https://2024.clojure-conj.org :)
- erichocean 2y agoIt's never been easier to turning existing developers into Clojure developers. A major problem people have at first[0] is just reading the code. AIs like ChatGPT and Claude are incredibly good at explaining existing Clojure code. As a result, developers can onboard much, much faster. [0] After a few weeks, reading Clojure becomes second nature and you'll forget you ever COULDN'T read it.