babashka

https://github.com/babashka/babashka. Also see #sci, #nbb and #babashka-circleci-builds .
tomd 2020-11-18T09:12:04.370700Z

What solution do people have for paredit/parinfer -like functionality when writing babashka on the command line? I guess this is a more general clojure problem, but I only write (non-babashka) clojure in emacs buffers or the cider repl, where I have smartparens. Just looking for paren-balancing and slurp+barfing really.

2020-11-18T09:26:38.371Z

I use this for Clojure: https://github.com/bhauman/rebel-readline

2020-11-18T09:26:49.371300Z

Not sure if it can be used for babashka

tomd 2020-11-18T09:30:42.371500Z

ah cool - I'll try it out. thanks

borkdude 2020-11-18T09:35:34.371700Z

If the expression becomes too clumsy for the command line I usually put my expression in a .clj file and edit with emacs

1👍
tomd 2020-11-18T09:48:46.371900Z

yeah that's what I've take to doing. Is there a way to use a readline lib like rebel-readline with babashka, or would that be something of interest for the future?

borkdude 2020-11-18T09:49:41.372100Z

currently not possible since this relies on jline, maybe something for the future, but probably not super high priority

tomd 2020-11-18T09:49:56.372300Z

yeah that's fair enough. thanks!

tomd 2020-11-18T09:56:16.372500Z

out of interest @didibus, how do you get the paredit functionality working with rebel readline using clojure cli?

nate 2020-11-18T14:10:15.373900Z

Thank you! I'm quite fond of them. They're key to one-liners being so easy to write.

borkdude 2020-11-18T14:16:22.374100Z

Some people love them, others find them confusing. I'm contemplating an alternative here: https://github.com/borkdude/babashka/issues/613 Just an idea so far.

borkdude 2020-11-18T14:16:47.374500Z

One downsize of using flags is that these things don't work well with full blown scripts

borkdude 2020-11-18T14:16:55.374700Z

So it would be nice if we could have something that worked in both cases

borkdude 2020-11-18T14:17:49.374900Z

I made a separate doc page for the io flags now, so people know how to port it to script usage: https://github.com/borkdude/babashka/blob/master/doc/io-flags.md

2020-11-18T15:33:47.376500Z

Is there a way with babashka/clj-kondo to have a call graph of a namespace? A graph showing which functions calls which? :)

2020-11-18T15:34:01.377Z

This would help me to know which function to test/how to test it.

borkdude 2020-11-18T15:36:46.377600Z

@neo2551 Yes, you can use clj-kondo as a pod from babashka and do something similar to https://github.com/benedekfazekas/morpheus

2👏
borkdude 2020-11-18T15:37:11.378Z

or just use morpheus directly

2020-11-18T15:38:22.378300Z

Thanks :)

2020-11-18T19:03:53.378600Z

Add this alias to your ~/.clojure/deps.edn

:rebel {:extra-deps {com.bhauman/rebel-readline {:mvn/version "RELEASE"}}
                   :main-opts  ["-m" "rebel-readline.main"]}
Then at the command line type: clojure -M:rebel

2020-11-18T21:24:25.379100Z

just made a small github action that installs babashka: https://github.com/turtlequeue/setup-babashka

5😎
borkdude 2020-11-18T22:10:59.379500Z

Good job :)

borkdude 2020-11-18T22:11:06.379700Z

Feel free to add to https://github.com/borkdude/babashka/blob/master/doc/libraries.md#projects

1