Fork me on GitHub
#babashka
<
2020-06-17
>
dpsutton00:06:38

Inf clojure can run bb as an inferior process and cider can connect to bb nrepl

Bobbi Towers01:06:42

Is there an nrepl or socket repl client that doesn't require Clojure? I'm trying to develop on a remote machine running Alpine Linux with only Babashka installed

dpsutton02:06:22

There’s an nrepl something written in ocaml. Not sure which side though

sogaiu06:06:41

for one-off nrepl evaluations there's rep: https://github.com/eraserhd/rep -- this is a native-image binary

👀 3
borkdude06:06:57

I think @bozhidar has a list of clients in his nREPL docs. I’m on the phone right now but can post the link later

borkdude06:06:45

Very exciting btw @porkostomus !

Bobbi Towers07:06:31

Oh cool, thanks!

borkdude07:06:48

@isak @nate About minimallist:

bb "(require '[minimallist.core :refer [valid?]] '[minimallist.helper :as h]) (valid? (h/fn int?) 1)"
true
Seems to work out of the box 🙂

😎 6
borkdude09:06:25

Even all the tests pass out of the box:

$ bb -cp "$BABASHKA_CLASSPATH":test-resources/lib_tests -e "(require '[minimallist.core-test]) (clojure.test/run-tests 'minimallist.core-test)"

Testing minimallist.core-test

Ran 1 tests containing 181 assertions.
0 failures, 0 errors.
{:test 1, :pass 181, :fail 0, :error 0, :type :summary}

👏 3
borkdude09:06:47

it seems it doesn't do any parsing right, only validation?

borkdude10:06:11

Was just reminded of this cool feature: polyglot Makefiles with babashka: https://twitter.com/borkdude/status/1261358361523691520

👀 3
12
borkdude11:06:22

another thing I just found out: *command-line-args* can be rebound just like any other dynamic var:

(binding [*command-line-args* ["-Sdescribe"]]
  (load-file "deps_test.clj"))

borkdude11:06:38

I mean, it's not that surprising but I never used it like this

borkdude14:06:02

Is there something like `(System/getProperty "foo.version")` that can contain any kind of Object, not just strings? I proposed a System property before, but one has to parse the version with string/split etc to compare it for "newer" etc which might not be that ergonomic (although doable)

borkdude14:06:03

well, maybe this isn't too bad:

(pos? (compare (mapv #(Integer. %) (str/split "0.1.2" #"\.")) [0 1 1]))
true

lukasz14:06:23

According to the java doc set/get property accepts and returns strings only

borkdude14:06:54

yes, also according to the REPL

borkdude22:06:23

Might be using sci in clj-kondo soon:

🎉 6