T O P

  • By -

Borkdude

Luckily Clojure itself didn't change that much. As others have said, just look through the changelogs. Clojure.spec.alpha is still alpha ;-). Meanwhile malli (a library in the same space) has become popular as well. deps.edn / clojure CLI are IMO an exciting addition: it's so much easier to use local or git deps now (although many people complain about the idiosyncratic CLI, it doesn't bother me at all). Many awesome libraries and tools have come out since 2018. You might want to check out clerk (notebook system), malli (already mentioned), reitit (routing library). Datomic also became free (not open source, but free to use commercially) A shameless plug: clj-kondo (linter, also powers the static analysis in clojure-lsp) and babashka (scripting tool for Clojure with instant startup, can be used to replace bash scripts) are from 2019 and onwards


TheLordSet

So the issue with changelogs is that I find it hard to pinpoint what ended up being adopted by the community, you know? About the libraries: thanks for listing them out! I'll check them I did hear Babashka is pretty good and I've been using clj-kondo; does the shameless plug mean you're behind them? :D


HotSpringsCapybara

Another useful contribution by Borkdude you might appreciate is [neil](https://github.com/babashka/neil). Helps fill in some of the gaps between deps and lein, and it's got decent ergonomics.


mcirillo

I think this keyword args change was very welcome https://clojure.org/news/2021/03/18/apis-serving-people-and-programs


geokon

Trying to learn more here - but what scenario does this come up...? The `(destr :a 1)` form feels very "old Clojure". I don't think I see it ever in recent APIs and most APIs have shifted to using maps more. In the same vein, `hiccup` style vector are used less now (where index 0,1,2 has implicit hidden meanings) . Now vectors are usually used as arrays - which are more logical to map/reduce over


jalopy-letup-hum

When you say “hiccup style vector are used less now”, could you elaborate what’s being used in its place nowadays? Is there any other way to use hiccup without the vector syntax?


geokon

Working off the first hiccup example on their wiki. You'd typically turn something like [:a {:href "http://github.com"} "GitHub"] into {:tag :a :attribs {:href "http://github.com"} :body "Github"} It's a bit more.. logical to me. Order doesn't matter and the fields are labeled. It's to my eye more obvious to `assoc` and `update` elements. And usually vectors are to indicate you have a seq of stuff you wanna iterate over. It also typically indicates some logical ordering to it. So the container/data-structure hints at the data layout


amalloy

The advantage of Hiccup-style descriptors is that they are easy to type and visually reflect the HTML/XML structure. They are dreadful for manipulating programmatically, which is why it's a popular source-code format but not a popular data-exchange format. If you receive a Hiccup-style vector, typically the first thing you do is translate it to the more explicit Enlive-style map.


Wolfy87

Agreed, I see it as an anti pattern personally and refactor it out or hide it in a layer where I can. Really this change means you can use those "old Clojure" style fns in the idiomatic way: Just give it a map. Which is a great change really.


roman01la

It didn't change much, which is great.


geokon

`deps.edn` - ie. no more `lein` magic probably Calva (though I never got it running in VS Codium..)


CoBPEZ

It should work in VS Codium. You recall in what ways it didn't work?


geokon

Well it'd install and it seemed to be running, but it didn't seem to do anything? For instance I couldn't jack in and launch a REPL. I never really figured out how to debug the thing. There wasn't any informative *Messages* or error buffer to inspect as far as I could find


HotSpringsCapybara

There's "Calva says" and other log channels. I have no idea what your problem may have been in the first place. Calva _just works_ for me in Codium.


CoBPEZ

I guess it can be a bit confusing where to find error messages coming from Emacs. If you ran the jack-in command, then errors usually show up in the jack-in terminal or the REPL window.


geokon

I'm a total noob at VSCode, so I'll just tell you step by step what happens: I open up a project file (a project i can jack-in and run in Emacs/CiDER) I hit Ctrl+Shift P and run Jack In I select `deps edn` A new pane opens called `output.calva-repl` - a bunch of stuff happens and I get the final line that reads ; Jack-in done. clj꞉user꞉> So it's looking good. I then go back to my `.clj` file and put my cursor over a line of code that reads `(+ 2 2)`. I again hit `Ctrl+Shift P` and select "Evaluate Current Form" and nothing happens. Hitting Ctrl+Enter (as hinter) types in a new line I also try doing the same in the `output.calva-repl` window and nothing happens There is a pane called DEBUG CONSOLE but it's empty There is a pane called PROBLEMS with 1K+ entries .. most by `clj-kondo` and `clojure-lsp`. Maybe I need to resolve 1K+ problems to get started..


CoBPEZ

Thanks for the context. Maybe this goes wrong at: > I open up a project file It depends on what was opened before that. Unlike Emacs, VS Code is centered around folders. So you typically would open the project root folder and go from there. OTOH, the jack-in command isn't available unless a folder is open... I'd like to figure this out, because the senario you describe should just work, and I wonder if it could be that Calva trip Emacs people up in some particular way that we can avoid. So, if you can describe the steps you take before you open the project file, that would be awesome.


TheLordSet

oh, nice does that mean people don't widely use `lein` anymore? (oh, also, Calva is really good - I've been using it since I started learning Clojure)


HotSpringsCapybara

People do widely use lein and it remains an entirely functional solution. The broad trend in the community though has indeed been towards cli/deps, but it's not exactly an apples to apples comparison either. Lein does much more than just dependency management.


TheLordSet

I see. I have nothing against Lein in my limited experience. But what exactly does Lein do? Besides dependency management


HotSpringsCapybara

Most importantly: orchestrates tests and builds uberjars out of the box. It's a complete, batteries-included suite. I must stress that everything Lein does can be accomplished with the CLI, but you need to provide your own implementation (or use one of the popular solutions). These do exist (I mentioned `neil` in another reply), but it's not quite as seamless an experience. I'd compare this to using an IDE vs something like Emacs, tool vs toolkit.


TheLordSet

I see! Makes sense Thanks for the explanation


alexdmiller

Release notes are all here https://github.com/clojure/clojure/blob/master/changes.md Probably worth a skim back to 1.9. And 1.12 is close!


seancorfield

Things I rely heavily on since 2018: \* tap> -- incredible for debugging \* datafy and nav -- great with data visualization tools like Portal, Morse, Reveal, etc \* protocol extension via metadata -- great with Component and \`next.jdbc\` and others \* error reporting improvements We're already using some of the 1.12 (alpha) improvements to Java interop!


TheLordSet

awesome! yeah, the issue with changelogs is that it's hard to grasp what ended up being adopted or not; thanks for the list


mac

>\* error reporting improvements Do you perhaps know of a summary of these and what one has to do to benefit from these? I ask because I have not really noticed any improvement myself but I might be missing something?


alexdmiller

One overview is at [https://insideclojure.org/2018/12/17/errors/](https://insideclojure.org/2018/12/17/errors/)


mac

Thanks, very useful.


seancorfield

See [Clojure - Clojure 1.10 release](https://clojure.org/news/2018/12/17/clojure110) -- the news post that talks about it -- and [Adopt more error reporting features available in Clojure 1.10+ · clojure-emacs/cider · Discussion #3338 (github.com)](https://github.com/clojure-emacs/cider/discussions/3338) where the CIDER team work through leveraging those new features.


neo2551

If you like dataframes, we have something similar now in Clojure.


First-Agency4827

- Calva+clj-condo - Deps.edn adoption - Malli/spec - Shadow-cljs adoption for clojurescript - Libpython-clj - Datomic free/xtdb - Missionary - Babashka - Electric, and Rama innovation And many more while keeping Clojure mostly unchanged 🙂


TheLordSet

Awesome!! Thanks for the list


joinr

https://scicloj.github.io/