improve-getting-started

Slackbot 2021-08-26T04:14:56.003Z

This message was deleted.

pez 2021-08-26T12:41:03.025800Z

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?

pez 2021-08-26T12:45:47.026Z

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.. 😃

ericnormand 2021-08-26T09:20:07.024800Z

@ericnormand has joined the channel

Adam Stokes 2021-08-26T11:59:05.025700Z

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

eval2020 2021-08-26T13:06:06.027800Z

Direct link to this stream on Zulip would be https://clojurians.zulipchat.com/#narrow/stream/180378-slack-archive/topic/improve-getting-started

👍🏻 1
Adam Stokes 2021-08-26T13:15:04.031100Z

Thanks all

Adam Stokes 2021-08-26T15:39:58.041800Z

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

Alex Miller (Clojure team) 2021-08-26T15:42:32.042700Z

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

🙌 1
Alex Miller (Clojure team) 2021-08-26T15:48:15.043600Z

% 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) 2021-08-26T15:50:50.045600Z

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) 2021-08-26T15:51:56.046300Z

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 Stokes 2021-08-26T15:52:32.046500Z

That is super cool

seancorfield 2021-08-26T15:55:41.048400Z

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) 2021-08-26T15:55:41.048500Z

logged at https://clojure.atlassian.net/browse/TDEPS-206

Alex Miller (Clojure team) 2021-08-26T15:56:06.049Z

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

Alex Miller (Clojure team) 2021-08-26T15:56:45.050100Z

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

seancorfield 2021-08-26T15:57:22.050800Z

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)

seancorfield 2021-08-26T15:58:41.051800Z

(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) 2021-08-26T16:00:23.052800Z

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)

👍🏻 1
Alex Miller (Clojure team) 2021-08-26T16:01:22.053200Z

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

seancorfield 2021-08-26T16:03:35.054300Z

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) 2021-08-26T16:04:29.054800Z

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

seancorfield 2021-08-26T16:07:21.057200Z

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).

seancorfield 2021-08-26T16:07:55.057900Z

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

Alex Miller (Clojure team) 2021-08-26T16:08:09.058300Z

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

seancorfield 2021-08-26T16:08:17.058600Z

Ah, OK.

Alex Miller (Clojure team) 2021-08-26T16:09:55.060500Z

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

2021-08-26T16:10:46.061600Z

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?

2021-08-26T16:11:09.062Z

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

Alex Miller (Clojure team) 2021-08-26T16:13:33.064100Z

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

2021-08-26T16:14:42.065900Z

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) 2021-08-26T16:15:42.066800Z

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

Alex Miller (Clojure team) 2021-08-26T16:16:42.067800Z

regrets, I have a few

2021-08-26T16:18:51.069200Z

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?

2021-08-26T16:21:16.069700Z

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

Alex Miller (Clojure team) 2021-08-26T16:23:09.070800Z

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.

2021-08-26T16:25:19.073200Z

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.

2021-08-26T16:26:24.074700Z

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?

seancorfield 2021-08-26T16:26:27.074800Z

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) 2021-08-26T16:27:03.075300Z

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) 2021-08-26T16:27:22.075700Z

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

Alex Miller (Clojure team) 2021-08-26T16:27:35.076Z

what is useful is to hear what you find confusing

2021-08-26T16:31:15.079700Z

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) 2021-08-26T16:32:09.080100Z

it is useful for you to share this, thanks

Alex Miller (Clojure team) 2021-08-26T16:32:35.080500Z

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

Alex Miller (Clojure team) 2021-08-26T17:19:13.097700Z

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

Alex Miller (Clojure team) 2021-08-26T17:32:01.098900Z

yes

Slackbot 2021-08-26T17:39:37.101600Z

This message was deleted.

seancorfield 2021-08-26T17:46:20.102200Z

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

Alex Miller (Clojure team) 2021-08-26T17:49:17.103Z

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

seancorfield 2021-08-26T17:49:46.103700Z

(oops, I misread it too!)

Alex Miller (Clojure team) 2021-08-26T17:49:48.103800Z

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

seancorfield 2021-08-26T17:50:45.105100Z

(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) 2021-08-26T17:51:06.105400Z

sure

Alex Miller (Clojure team) 2021-08-26T17:51:29.105500Z

waves at the infinite branching of possible futures

Alex Miller (Clojure team) 2021-08-26T17:53:00.106200Z

or there could be a different command

seancorfield 2021-08-26T17:54:26.107400Z

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

seancorfield 2021-08-26T17:55:52.109700Z

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) 2021-08-26T17:58:21.112Z

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

Adam Stokes 2021-08-26T18:23:02.113Z

super glad the logbot is here now for ^

➕ 1
Bobbi Towers 2021-08-26T22:13:37.113500Z

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

❤️ 1
Jakub Holý (HolyJak) 2021-08-27T19:32:30.114Z

Nice! How does it work? Is it Clj-kondo + some custom data of the form [code-pattern warning-message]?

Bobbi Towers 2021-08-28T04:01:51.114700Z

That was my first idea, that clj-kondo would get us a good part of the way. Then I was really inspired by the ClojureD talk on Nextjournal's Clerk, where he says that they use a combination of rewrite-clj and tools.analyzer for their live notebook interface so I thought maybe that would be a good way to go. But then I realized that I'd just end up duplicating much of what clj-kondo already does so well, so that puts us back where we started.

Bobbi Towers 2021-08-28T04:21:19.115Z

We do use tools.analyzer in a separate tool, the representer. Its job is to take a solution and output a normalized version of itself, which a group of trusted mentors will be able to write standardized responses for. Running a form through the analyzer and having it emit a form back seems to do exactly that.

Jakub Holý (HolyJak) 2021-08-28T13:25:39.115300Z

Nice!