Fork me on GitHub
#improve-getting-started
<
2021-08-26
>
deleted04:08:56

clojure morsels goes out this week (or early next week if time ends up tight), so if there's something that ought to be shared about this effort let me know

pez12:08:03

Maybe mention that we are trying to increase the amount of beginner feedback to guide us in making it easier and more fun to start with Clojure? And mention the channel and encourage people who care about this work to join?

pez12:08:47

Personally I like that there is now this zero-install guide into the language and to the repl. But, as becomes obvious reading just the first comments we have gotten in here, there is so much more to it. We need to cover more bases and create a nice and cosy web of them.. 😃

Adam Stokes11:08:05

Slack question, I've been bookmarking conversations, should I be copying and pasting those into a file somewhere? Not sure the slack setup if those conversations stick around or not

Adam Stokes15:08:58

Yea that is pretty handy clx @babashka/bb run build 🙂

Alex Miller (Clojure team)15:08:32

you're about 90% of the way there combining clojure cli and find-versions from git deps and tools/install

🙌 3
Alex Miller (Clojure team)15:08:15

% clojure -X:deps find-versions :lib com.github.seancorfield/deps-new
{:git/tag "v0.1.0"}
% clojure -Ttools install com.github.seancorfield/deps-new '{:git/tag "v0.1.0"}' :as deps-new
Installed deps-new
% clj -Tdeps-new app :name foo/bar
Creating project from org.corfield.new/app in bar

Alex Miller (Clojure team)15:08:50

given the github org/project name, you can call the first command. the versions are sorted, so the last line is the newest. given the org/project + last coord, call the second command at that point, you have the tool installed with a local short name (the :as at the end), which you can then invoke

Alex Miller (Clojure team)15:08:56

we could probably make something that did the first part as a single step like

clj -Ttools install-latest com.github.seancorfield/deps-new

Adam Stokes15:08:32

That is super cool

seancorfield15:08:41

clojure -Ttools install can install a tool from Maven, Clojars, git deps, or even from somewhere locally. While I am testing deps-new, I'll often do clojure -Ttools install com.github.seancorfield/deps-new '{:local/root "."}' :as new so I can test clojure -Tnew ... in another directory.

Alex Miller (Clojure team)15:08:06

the downside of installing a tool from maven is that you don't get the deps usage features with that

Alex Miller (Clojure team)15:08:45

I'm not sure that will always be the case but it's a big TBD right now

seancorfield15:08:22

I think we should probably encourage more git deps and source-based installs -- I have quite a few things in my deps.edn that are git deps, as well as my ~/.clojure/tools folder (which is where clojure -Ttools install puts things)

seancorfield15:08:41

(right now the only reason I still publish some of those tools/libs to Clojars is because of cljdoc -- but they're working on being able to import git deps now)

Alex Miller (Clojure team)16:08:23

I think for tools, git deps are better in most cases (not ideal in cases where you want to proxy the net for control though, where a maven proxying repo like Nexus can be used)

3
Alex Miller (Clojure team)16:08:22

probably we have strayed from the intent of the channel at this point :)

seancorfield16:08:35

No, I think knowing the the CLI / git deps / tools is already available and gets us close to npx usage is valuable -- but it makes it clear there's a documentation gap since that information isn't widely known yet.

Alex Miller (Clojure team)16:08:29

I'd be happy to write a guide focused on tool use, that stuff is pretty buried right now

seancorfield16:08:21

Do you think some of this should be up front in the Getting Started page? Although I guess the downside is mentioning specific tooling would sort of "bless" that at the expense of other community projects. deps-new as a tool to quickly create new app/lib projects -- which have fully-fleshed out deps.edn files that include testing, building JARs, deploying (to Clojars).

seancorfield16:08:55

(I plan to modify the templates for deps-new to use tools.build more "soon")

Alex Miller (Clojure team)16:08:09

I actually rewrote the entire Getting Started area in January but it's still pending some stuff so hasn't been merged

Alex Miller (Clojure team)16:08:55

with respect to deps-new, I think it's useful in some cases, but really the big thing with deps is you shouldn't need it to get started. with git deps and git publishing, you don't need to build jars or deploy to clojars

Asko Nōmm16:08:46

I got invited here by Clojure Morsels on Twitter, and thought I'd chip in. In particular the clj command line tools arguments are hard to understand, or memorize. In comparison to tools like npm, yarn, things like -X, Ttools, seem odd at the very least. Is there a particular reason for this complexity and/or room to improve that?

Asko Nōmm16:08:09

Lein, for example, is a lot friendlier in terms of commands to remember.

Alex Miller (Clojure team)16:08:33

lein is pointed in a different direction than the Clojure CLI, which is a generic program runner with dependency support.

Asko Nōmm16:08:42

Take for example this: clj -A:test -Spath, which is used to apply a classpath modification and examine the modified classpath, if I understood the docs clearly. Yet I have no idea what the -A stands for, or why (what I assume) classpath is stated as -Spath and not just classpath.

Alex Miller (Clojure team)16:08:42

well, you can bike shed every decision here. like any software, there are historical reasons how we got here

Asko Nōmm16:08:51

Not at all my intention, honestly. I'm just trying to figure out if there is room for improvement or not, because it is very hard for anyone new to actually know how to use this tool without constantly referring to the documentation, and flat out trying to memorize the commands somehow. The idea is to make using Clojure easier here, no?

Asko Nōmm16:08:16

And perhaps this is by design, and that's fine then.

Alex Miller (Clojure team)16:08:09

certainly open to ideas to make it better/easier, but those also need to be balanced against backwards compatibility and the overall design goals. I don't understand how you can use any tool without learning how to use it.

Asko Nōmm16:08:19

Sure of course, but there is a big contrast between a tool with clear english terms, and a tool that uses acronyms (acronyms+word?) instead, which while it would not eliminate learning, it would make the learning easier.

Asko Nōmm16:08:24

I wonder if there would be room for adding command aliases, which would keep the original functionality intact, but allow it to be used in a more verbose way?

seancorfield16:08:27

Is npx really any easier to learn/use though? Serious Q.

npx [options] <command>[@version] [command-arg]...

       npx [options] [-p|--package <pkg>]... <command> [command-arg]...

       npx [options] -c '<command-string>'

       npx --shell-auto-fallback [shell]
and it has nearly a dozen options listed in the help.

Alex Miller (Clojure team)16:08:03

git uses a lot of English words but I still find it largely inscrutable when I don't understand the underlying model

Alex Miller (Clojure team)16:08:22

I don't think this is a useful argument to have though

Alex Miller (Clojure team)16:08:35

what is useful is to hear what you find confusing

Asko Nōmm16:08:15

What I mean by command aliases, is that often times those starting out prefer to use a full descriptive commands as they are easier to remember/reason about. Say instead of clj -X they could run clj run or clj --execute . Over time as users get more comfortable/used to a tool, they also tend to start using the shorthands like -X for things, but having everything be -X, -A, -S and what-not by default is daunting and off-putting. Just my $0.02, and I understand I may be in the minority thinking this here and that's fine.

Alex Miller (Clojure team)16:08:09

it is useful for you to share this, thanks

Alex Miller (Clojure team)16:08:35

we don't know whether it's a minority or common opinion unless people share things :)

Alex Miller (Clojure team)17:08:13

we can still add things while keeping the old stuff for backwards compatibility

deleted17:08:37

was your response meant to be "clj could potentially do some of these sorts of things just in a backwards compatible way"? or "clj can be changed in backwards compatible ways (but probably won't anything like those changes)"? I was pretty sure it was the latter

seancorfield17:08:20

Alex is currently in the Debian Clojure BoF session so he'll probably be a bit delayed in responding.

Alex Miller (Clojure team)17:08:17

oh sorry, I misread your question (isn't/is)

seancorfield17:08:46

(oops, I misread it too!)

Alex Miller (Clojure team)17:08:48

I think it is conceptually possible to both support a new command style and also be backward compatible with the old style

seancorfield17:08:45

(and that's partly because clj script is deprecated in favor of clj -M script now -- and so clj command args could be possible in the future?)

Alex Miller (Clojure team)17:08:00

or there could be a different command

seancorfield17:08:26

(like a clx script that built "traditional" arguments/options and invoked clojure maybe 🙂 )

seancorfield17:08:52

FWIW, this sort of thing was partly why we had a build shell script at work so we could translate high-level "commands" into low-level clojure invocations, so that test would expand out to -X:test:plus:lots:of:other:aliases etc.

Alex Miller (Clojure team)17:08:21

composite aliases is another thing to eventually look at but I think that's a separate problem

Adam Stokes18:08:02

super glad the logbot is here now for ^

3
Bobbi Towers22:08:37

At Exercism we're developing code analysis tooling for the purpose of identifying common errors and providing automated feedback, in an effort to save human mentorship for where it is better suited - the uncommon errors people make. Any silly mistakes we can address before a solution enters the mentoring pipeline helps accomplish this goal. I'm mentioning this here because so many people go there to learn Clojure that it represents a significant chunk of our collective "educational canon", and it's not a huge exaggeration to say that any effort invested in this project has the potential to reach infinitely many students. If this sounds like fun to anyone else I could definitely use some help because I'm the only one working on it for some reason. Even if just to bounce ideas around. I'm happy to take this on but I've never developed tooling before so I'm just figuring it out as I go. https://github.com/exercism/clojure-analyzer