This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-15
Channels
- # announcements (8)
- # architecture (9)
- # autochrome-github (1)
- # babashka (48)
- # beginners (55)
- # calva (36)
- # cider (16)
- # clj-commons (1)
- # clj-kondo (38)
- # cljs-dev (44)
- # cljsrn (1)
- # clojure (164)
- # clojure-europe (35)
- # clojure-nl (2)
- # clojure-norway (10)
- # clojure-uk (23)
- # clojurescript (50)
- # conjure (24)
- # core-async (1)
- # cryogen (2)
- # cursive (38)
- # datalevin (11)
- # datascript (2)
- # datomic (13)
- # duct (1)
- # emacs (16)
- # events (12)
- # exercism (3)
- # figwheel-main (7)
- # fulcro (26)
- # honeysql (5)
- # integrant (1)
- # jobs (3)
- # kaocha (6)
- # lsp (72)
- # malli (22)
- # nextjournal (35)
- # nrepl (1)
- # off-topic (34)
- # pathom (5)
- # polylith (8)
- # portal (40)
- # re-frame (14)
- # reagent (42)
- # reitit (1)
- # releases (1)
- # remote-jobs (1)
- # reveal (9)
- # sci (2)
- # shadow-cljs (13)
- # sql (3)
- # tools-deps (33)
- # vim (25)
How does one install sci
as an external dependency?
I try to run tests of malli
and they fail with this error: :malli.core/sci-not-available
What should be the file? ~/.clojure/deps.edn
?
The deps.edn
in your project. But if you are running malli's tests from the malli repo, it's likely that you'll have to include some alias. Ask in #malli
If you are working on malli, maybe you can also upgrade SCI, it has some performance boosts in 0.3.0.
Unfortunately I only want to fix one bug 🙂
@benjamin.schwerdtner halt-when
is added on master, available in the next release.
you can download a master snapshot from https://github.com/babashka/babashka-dev-builds or install using
bash <(curl ) --version 0.7.5-SNAPSHOT --dir .

Hey. Is there a way to use muuntaja in babashka?
It says that it can't find java.util.concurrent.ConcurrentHashMap
.
I want to parse JSON input. But it crashes for some reason.
bash scripts/test-permissions-babashka.sh
----- Error --------------------------------------------------------------------
Type: java.lang.Exception
Message: Unable to resolve classname: java.util.concurrent.ConcurrentHashMap
Location: muuntaja/parse.clj:3:3
----- Context ------------------------------------------------------------------
1: (ns muuntaja.parse
2: (:require [clojure.string :as str])
3: (:import (java.util.concurrent ConcurrentHashMap)))
^--- Unable to resolve classname: java.util.concurrent.ConcurrentHashMap
4:
5: ;;
6: ;; Cache
7: ;;
8:
----- Stack trace --------------------------------------------------------------
muuntaja.parse - muuntaja/parse.clj:3:3
muuntaja.core - muuntaja/core.clj:3:3
<omitted>
user - <expr>:1:10
Also this: [metosin/muuntaja "0.6.8"]
Maybe it's an old version?
Well the project's original author was parsing JSON this way. So I thought that I don't want to add cheshire as I should reuse the same lib. But well... it doesn't work.
I know. And I used it this way. But JAR build failed because I didn't include cheshire into the project's lein dependencies. Which meant that I have to not use cheshire for that namespace (import failed).
I think you're right. And that means that the library wasn't used properly in the first place.
Yep. I didn't even know that muuntaja uses cheshire. Thanks.
This says that muuntaja
uses jsonista
by default and cheshire
is one possible adapter that could be used:
https://github.com/metosin/muuntaja#modules
Ok, makes sense. But if you want to parse JSON in bb, you don't need this library. Just use Cheshire
Yes but that means that I would need to include the cheshire into the project's dependencies even if I would use jsonista
. Because if I import cheshire then JAR doesn't want to build. I may use profiles for that but it's more cumbersome.
Or then I'd need to move out the babashka-main
namespace. I don't yet know what would be the best pattern for that.
You could also use reader conditionals for this or a .bb file which is prioritized over .clj
Does bb
have a reader conditional? Also I can't return
from namespace evaluation once I detect that I can't run it.
It's probably my best bet if I'd include both libraries into the project.
Nah, my code is not public. But it's fine. I figured it out.
I'll use the conditionals in multiple places and I'll have cljc
file. 🙂
That works. You can also isolate the change in one place in a function and then call that json function throughout the rest of your code.
I have a conditional in imports and then I have a conditional in encode/decode functions. I don't yet know what I'll do if I'll need a InputStream
or OutputStream
as output but that's fine for now.
No, I think IOStream
is something that I made up in my mind. I think it could come from C++... Java has InputStream
and OutputStream
.
No, that's fine. I was thinking about JSON parsing into a Java stream. But cheshire should do it just fine. I'll only need to add a function that does this.
If I'll need it 🙂
how should I remove babashka options from command-line-args. E.g. "--parallel" will be an arg
I was misspelling the arg that's why 🙈 all good