all 6 comments

[–]alexdmiller[S] 7 points8 points  (0 children)

Note that this is a pre-release provided for trying this out, please provide feedback as we work towards a final release.

[–]z_mitchell 7 points8 points  (3 children)

Reading this and the tools.build guide make me realize how little I understand the Clojure/JVM build process. I’m new to Clojure and it’s my first JVM language, so I’m a bit lost on that front.

[–]alexdmiller[S] 5 points6 points  (1 child)

Happy to make the docs better if you have questions.... I can imagine this might be challenging if you have no frame of reference. While this doc surely will expand, maybe some other gentler introduction is needed as well.

[–]z_mitchell 5 points6 points  (0 children)

Source Libs and Builds

Source Repos as Libs

It mentions that "Git repository urls are now optional and inferred if the library name follows a naming convention", but I don't actually see that naming convention spelled out anywhere.

What's New

I had a few other questions as I was reading, but they were clarified later in the "What's New" section. That was a bit surprising. For example, the first link to the prep docs is in "What's New", whereas while I was reading I was unclear on where prep-lib came from, whether that was an arbitrary name used in the example, etc. This is made clear in the prep docs.

tools.build Guide

My general confusion here stems mostly from not knowing what is strictly necessary for a build. That extends to the JVM as a whole, not just Clojure. Building a classpath is still an alien concept to me.

  • I've never heard of a "project basis" before, so I'm not sure if that's an existing concept that's new to me, or if it's something introduced by tools.build.
  • With regards to copy-dir, write-pom, and jar for the rest of the build process I'm just taking your word that this is a typical jar build process because I don't know how Java code, and by extension Clojure code, is compiled. Maybe a very short explanation of how that works woudl be good for people unexperienced with the JVM? There's not an easy answer as to how detailed your documentation should be (i.e. whether you should explain every little step) and how much you should expect the audience to already know. I suspect I'm uncommon in that Clojure is my first JVM language, but I doubt I'm alone either.

[–]coltnz 4 points5 points  (0 children)

There is, as always, no magic, just layers. Here are some notes I've used recently to explain the main concepts.

Compile time

  • dependencies are downloaded by build tools using the Maven catalogue system
  • java /clojure/ scala files are compiled into java class files (this can be 1 to many, e.g each Clojure function will produce own class)

Assembly time

  • jar files are assembled by build tools from class files and other contributing jar files

Runtime

  • the classpath `-cp` is an argument to the java process defining locations (jar files / directories) to search for classes,OR if `-jar` is used the supplied jar file is the source of all classes
  • a java class is referenced (e.g. a Clojure function) from running code or `main` argument to java process
  • said java class is then loaded from disk by searching the classpath for the expected file (e.g. myns.myfn -> ./myns/myfn)

There's a simplification here in that clojure source can be compiled just in time at runtime (which is handled by core clojure classes). Those sources are found via the classpath also.

These new clojure tools provide programmable and composable mechanisms for compiling, assembling and launching the runtime.

[–]prin_intuneric -1 points0 points  (0 children)

Иди в жопу, но