This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-29
Channels
- # announcements (3)
- # babashka (47)
- # beginners (88)
- # calva (17)
- # clj-kondo (8)
- # cljdoc (1)
- # clojars (9)
- # clojure (98)
- # clojure-europe (53)
- # clojure-norway (2)
- # clojure-seattle (1)
- # clojure-uk (5)
- # clojurescript (20)
- # cursive (11)
- # data-oriented-programming (1)
- # data-science (3)
- # datahike (1)
- # datascript (3)
- # events (3)
- # graalvm (5)
- # honeysql (7)
- # hyperfiddle (1)
- # jobs-discuss (10)
- # leiningen (3)
- # malli (16)
- # music (4)
- # nbb (17)
- # off-topic (45)
- # pathom (9)
- # portal (7)
- # releases (1)
- # shadow-cljs (80)
- # sql (15)
- # tools-build (5)
- # xtdb (23)
babashka on Heroku: Docker or some other way?
Not sure, but here are some docs for http://fly.io: https://github.com/babashka/nbb/tree/main/doc/fly_io
@U8VE0UBBR afaik heroku has some particular languages support https://devcenter.heroku.com/categories/language-support and clojure seems to be only the JVM flavour. Docker would be my recommendation.
Now integrating #babashka-cli into bb
$ clj -M:babashka/dev -x clojure.core/identity --foo 1 --bar 2
{:foo 1, :bar 2}
$ cat bb.edn
{:tasks {doit (prn (exec clojure.core/identity))}}
$ clj -M:babashka/dev doit --foo --dude 2
{:foo true, :dude 2}
Babashka 0.9.159 released, babashka tasks meets babashka CLI! https://blog.michielborkent.nl/babashka-tasks-meets-babashka-cli.html
Hrm, I’m getting an error “SHA256 mismatch” when running brew install borkdude/brew/babashka
on an M2 Mac. Is this just some CI thing catching up?
λ brew install borkdude/brew/babashka
==> Downloading .
==> Downloading from
######################################################################## 100.0%
Error: babashka: SHA256 mismatch
Expected: f4f140b5382fc11bb46808f40343a408032b5c00f3f3c2216637c17d49ce07c4
Actual: e9243d8f107929e8079917495ee6ea86845cdfb0c00e00f4050e2fa5264dd82b
File: /Users/john/Library/Caches/Homebrew/downloads/44000a26468468a117db36aa8ab9df092eb00b6a144e876356fa04cf57d3fc29--babashka-0.9.159-macos-aarch64.tar.gz
To retry an incomplete download, remove the file above.
Random hack to keep the order of keys from a JSON object (had a config file read with babashka and didn't want to turn the json object to a vector): https://gist.github.com/viesti/403e3a67e2bc1add10cf3365ede510bc
Amazing hack :) Would you mind posting the code in a gist or so? This will help sharing it and will also not flood this channel that much ❤️
A pain point I'm hitting is that when exceptions occur, there's no indication of my code at all, it's all in the sci namespaces due to interpretation; could there be a way of getting something stack-trace-like that showed which interpreted functions were invoked leading up to the exception?
Ah, looking at https://github.com/babashka/sci/issues/774
On the command line you should already be seeing a stacktrace but in some cases this can also be improved
Yes, in the REPL, haven't tried w/ command line. But I'm really happy that the Cursive support for BB is close to standard the Clojure dev experience.
Is this the nREPL? Ah yes, there is a known issue about it. https://github.com/babashka/babashka.nrepl/issues/42
Yeah, if my memory aint broken, I find this too when hitting an exception when running bb tasks.
My tasks usually just invoke a -main
of a bb script.
If I need to debug I sometimes just invoke the script directly for a better stack trace.
For example instead of bb test-doc
I’ll do a bb script/test_doc.clj
when debugging.
I think here's a report: https://github.com/babashka/babashka/issues/1322
Experience is much better as a command:
----- Stack trace --------------------------------------------------------------
clojure.lang.AFunction/1 - <built-in>
clojure.core/apply - <built-in>
net.lewisship.bb.tasks-test - /Users/howard.lewisship/workspaces/hlship/flow/test/net/lewisship/bb/tasks_test.clj:63:1
user - /Users/howard.lewisship/workspaces/hlship/flow/./run-tests.clj:8:1
yes, that's what the babashka.nrepl issue is about. The information is there. Just needs to be sent over
As promised, got to my todo: https://github.com/babashka/babashka/issues/1322#issuecomment-1207260158
I'm now looking on this. I do have the relevant data, but I'm not sure how to make an nREPL client display that data.
Hmm, it seems it's not so easy because nREPL is built with the expectation of a JVM environment: https://clojurians.slack.com/archives/C17JYSA3H/p1660237346960269
For obvious reasons, I'd like to leverage io.aviso/pretty with babashka, but that fails:
> rlwrap bb
Babashka v0.9.159 REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.
user=> (require '[io.aviso.repl :as repl])
Could not resolve symbol: Thread$UncaughtExceptionHandler [at io/aviso/repl.clj]
user=>
The code is:
(defn uncaught-exception-handler
"Returns a reified UncaughtExceptionHandler that prints the formatted exception to `*err*`."
{:added "0.1.18"}
[]
(reify Thread$UncaughtExceptionHandler
(uncaughtException [_ _ t]
(binding [*out* *err*]
(printf "Uncaught exception in thread %s:%n%s%n"
(-> (Thread/currentThread) .getName)
(e/format-exception t))
(flush)))))