5 ms·
I've tried deps several times, but I keep coming back to leiningen. Can anyone explain the advantage of using deps to me? What I want from a build tool is: man
by synthc 5y ago
I've tried deps several times, but I keep coming back to leiningen. Can anyone explain the advantage of using deps to me?
What I want from a build tool is: manage dependencies, starting a repl, running tests, and building a jar.
Leiningen provides me this: lein repl, lein test, lein uberjar. Simple and exactly what I need, and importantly: i can expect that all leiningen projects use the same commands.
Deps can be made to do all these things, and more, but you need to configure it.
Which test runner should I use for tests? Which library should I use to build an uberjar?
Since it's all configurable, I risk that every deps project gets it's own special snowflake build setup, and I need to spend time avoiding this.
Until deps gets a standard way for building and testing, i'm sticking to leiningen.
- dustingetz 5y agodeps is extremely simple, which means very little time spent debugging, and it never breaks
- beders 5y agodeps can't produce stable builds as it insists dependencies are not ordered. Yet on the classpath they are. That order shouldn't matter, but it very well does. lein AFAIK produces the same classpath every time. deps: Maybe put the paths first and then let's gamble what a seq on a map produces...
- dustingetz 5y agothanks, didn’t know that, will definitely be annoyed when i hit that someday
- john-shaffer 5y agoThat appears to have been true for only about a month: https://groups.google.com/g/clojure/c/WI3ddZRK4Bg/m/RtJVt3IZBwAJ https://groups.google.com/g/clojure/c/WI3ddZRK4Bg/m/RtJVt3IZ... https://github.com/clojure/tools.deps.alpha/commit/c22ad46c6cf913448ea33d40434e4e8dfb3ef2b3 https://github.com/clojure/tools.deps.alpha/commit/c22ad46c6...
- divs1210 5y agoI have never stressed over or debugged Leiningen in my 6 years of Clojure experience. Not sure what you're on about.
- divs1210 5y agoSame. I don't want to spend time learning build tools and configuring builds - I want to Get Shit Done. Lieningen gets out of my way and lets me do the things that really matter, and I'm not switching till I see some clear advantages of the new tooling.
- tut-urut-utut 5y agoExactly. Lein is like maven, declarative and just works in a standard way for 95% of use cases. Deps is like ant, can do anything, super flexible, but you need to start from scratch actually programming your build for every project.
- fnordsensei 5y agoI first used deps when doing a project with Datomic Cloud. I like deps, but I can’t quite articulate why.
- filoeleven 5y agoAfter using it with Datomic Cloud, do you prefer it also for local projects? Is there something that happened with Datomic Cloud configuration that made it “click” for you elsewhere? Did you just have to use it there and that experience informed your preferences? Data > functions > macros is a core concept of Clojure. Does that come into play here? These are prompts from a curious outsider’s perspective.
- john-shaffer 5y agoI found an old thread that examines some of the early usage of deps. Data > macros does indeed seem to be a driving force: https://clojureverse.org/t/combining-tools-deps-with-leiningen/658 https://clojureverse.org/t/combining-tools-deps-with-leining... tools.deps makes better choices when dependency specs conflict, so I would suggest trying https://github.com/RickMoynihan/lein-tools-deps https://github.com/RickMoynihan/lein-tools-deps if you otherwise want to use lein, and get the best of both worlds. By better, I mean: > Leiningen and Maven, when there is a conflict always pick the version that is closest to the root of the dependency tree; where as tools.deps always picks the newest.
- filoeleven 5y agoLeinengen vs Maven dependency resolution is pretty distant to my concerns. I may be in the minority there, but I don’t think I am. I guess the thing I’m struggling to understand in the build tool differences is: Leinengen’s (defproject) takes a series of keys and values. It is declarative. You can probably get into dependency hell if your config is complex enough, and I’m almost certain it’s doing more than I understand under the hood. (like why doesn’t it just take a map instead of being a macro?) tools.deps OTOH appears to need both a bunch of top-level definitions in a namespace (instead of a map literal) AND a hand-rolled build.clj file with custom functions to do most of the things that leinengen considers to be boilerplate. This does imply that you have much more flexibility with tools.deps, but it also raises the bar for entry, and it doesn’t appear to be as data-centric. If I want to do ANYTHING meaningful with Clojure, I need a project environment to start with. I am not confident about how to do this with clj, even after reading https://clojure.org/guides/deps_and_cli#_writing_a_program https://clojure.org/guides/deps_and_cli#_writing_a_program Maybe I just haven’t found the right guide, or maybe clj wants me to commit more to working REPL-first than my dev environment (VS Code + Calva) has good support for. What I’m wondering now is, if the gains that tools.deps provide are worth the entry price, does it make sense to have something like “create-react-app” to generate a project directory with sane defaults that can be customized if/when needed, if your project doesn’t fit the 90% case? Does this already exist? ‘dustingetz linked the Simple Made Easy talk. I get the distinction between the two, and I don’t want to swallow the hairball. I’m already sold on the Clojure paradigm. But I ALSO still want to “get this instantly and start running it in five seconds,” and I don’t understand why I’m not allowed that if I choose tools.deps. I don’t think the two goals are more than accidentally orthogonal.
- bokchoi 5y agoIt's like we learned nothing from years of suffering with snowflake Ant builds. Then again, gradle builds seems to be more popular than maven these days.
- pjmlp 5y agoThat is what happens when a new generation has grown without Ant and then a giant behemoth with endless cash for top hardware gets a deal to push Gradle as the official build tool for their mobile OS.
- vore 5y agoI would think that Gradle is a lot more pleasant to use than Ant...
- pjmlp 5y agoNot for those that don't suffer from XML allergy, so given that, the outcome is almost the same, with the caveat that Gradles uses a ton of more resources than Ant, as it needs its background daemon sucking up 2GB to pretend being fast.