depstar

Discussion around https://github.com/seancorfield/depstar
awb99 2021-02-22T09:15:49.002200Z

How does depstar compare to leiningen uberjar?

seancorfield 2021-02-22T16:45:28.003500Z

@hoertlehner Not sure how to "compare" them -- If you're using lein, you would use lein uberjar to build an application JAR file; if you're using the CLI and deps.edn, you would use depstar to do it.

seancorfield 2021-02-22T16:46:17.004500Z

I use depstar to build all the library JAR files that I deploy to http://clojars.org for my open source projects. I also use it at work to build all the production artifacts we deploy to our servers.

awb99 2021-02-22T16:48:01.004900Z

Thanks @seancorfield

awb99 2021-02-22T16:48:21.005600Z

I was thinking perhaps depstar has some additional features compared to lein uberjar

seancorfield 2021-02-22T16:54:23.007300Z

Well, you can't use depstar with lein and project.clj, only with the Clojure CLI and deps.edn -- and I don't really pay much attention to what Leiningen does as I haven't used it for years.

awb99 2021-02-22T17:00:28.007700Z

@seancorfield Thanks a lot!

awb99 2021-02-22T17:01:27.009500Z

If I would build an uberjar with aot for a LIBRARY .. would this means that functions from that library would load faster in case the app is not an uberjar with aot compilation?

awb99 2021-02-22T17:01:54.010300Z

Also would this aot library be dependent on the java version or the cpu architecture?

seancorfield 2021-02-22T17:09:20.011Z

You should never AOT compile a LIBRARY -- it can cause problems for users.

awb99 2021-02-22T17:56:47.012Z

I understand that. But I have a special usecase. A notebook application that needs to load dependencies dynamically.

awb99 2021-02-22T17:57:06.012700Z

What kind of problems could it generate for a library?

seancorfield 2021-02-22T18:03:11.014600Z

It can cause conflicts for users of your library with other dependencies in applications they are building with it because the code may be tied to specific versions of things your library depends on (such as Clojure) -- also AOT compilation is transitive so you end up with more than just your own compiled code in the library.

seancorfield 2021-02-22T18:03:58.015600Z

The general advice is: never AOT compile a library, end users can AOT an application for deployment safely -- and it's the AOT of the application that gets them the startup time improvements.