babashka

yogthos 2026-06-02T14:02:36.226279Z

I managed to make a shim on top of Janet which boostraps sci https://github.com/yogthos/jolt

👏 1
👏🏼 1
😮 1
yogthos 2026-06-02T14:55:06.186349Z

I still need to port immutable data structures, but the fact that it manages to compile all of sci and run it is pretty cool

borkdude 2026-06-02T14:57:00.696599Z

does it also pass all of the tests? ;)

borkdude 2026-06-02T14:57:49.959779Z

perhaps SCI could even support janet, but I don't know how much of a stretch that is. I don't know janet very well and don't know if it's close enough to clojure to do it with reader conditionals

yogthos 2026-06-02T14:58:54.540819Z

yeah looks like the tests pass

borkdude 2026-06-02T14:59:12.200239Z

I also wanted to support ClojureDart, to build a phone app where you could evaluate some CLJD in a phone app, sound like fun

yogthos 2026-06-02T14:59:17.045569Z

it's still very raw though, so bugs are definitely there 🙂

yogthos 2026-06-02T15:00:19.151119Z

thinking about this too, might actually be useful to have immutable data structures as a compile time toggle

yogthos 2026-06-02T15:00:59.707709Z

oh and I just kind of assumed ClojureDart was already using sci

borkdude 2026-06-02T15:02:31.087939Z

why did you think?

yogthos 2026-06-02T15:04:36.003249Z

since sci is already fairly self contained it seems like an obvious choice if you're porting Clojure to a new runtime no?

yogthos 2026-06-02T15:05:05.150749Z

there is edamame layer which I did have to shim, but that was pretty small

borkdude 2026-06-02T15:05:26.584169Z

well SCI is an interpreter, ClojureDart isn't an interpreter but a compiler

yogthos 2026-06-02T15:06:17.092669Z

that's true, I guess just taking cljs directly makes more sense there

borkdude 2026-06-02T15:06:35.419829Z

cljs?

yogthos 2026-06-02T15:07:07.425269Z

wouldn't you want to reuse most of the implementation?

yogthos 2026-06-02T15:07:17.204759Z

does ClojureDart just do everything from scratch?

borkdude 2026-06-02T15:07:51.914949Z

I don't know

neumann 2026-06-02T17:50:00.726599Z

Pretty cool! Is it possible to call a Janet function from Clojure code?

neumann 2026-06-02T17:51:38.390709Z

(Also, there is a #C015LCR9MHD channel too.)

borkdude 2026-06-02T17:51:44.375259Z

without looking at the code, this should work since it's explicitly tested in SCI

yogthos 2026-06-02T17:55:52.341619Z

oh yeah I missed the sci channel, and yeah calling Janet code should work, I'll add explicit interop there

👍 1
2026-06-02T19:24:23.817869Z

What's your use case? 🤔

yogthos 2026-06-02T19:28:47.774649Z

I'm using Janet as the plugin system here https://github.com/dirge-code/dirge so I was thinking I could get full blown Clojure here relatively easily

yogthos 2026-06-02T19:29:10.846059Z

Janet is nice, but it's just different enough to trip me up 🙂

👍 1
borkdude 2026-06-02T19:31:38.042379Z

maybe jank would also work? not sure if C++ and Rust stuff mixes well, but .. probably?

yogthos 2026-06-02T19:39:27.750899Z

I did look at it, but the runtime would be pretty chunky compared to Janet, and the build pipeline would also be more complex

yogthos 2026-06-02T19:40:01.826159Z

Jank is great, but Janet is a lot more compact and easier to embed, also has a Rust wrapper already as well

borkdude 2026-06-02T19:41:13.975719Z

there's a bunch of go clojure dialects now too. maybe also easy to embed. I just saw a post in #C8NUSGWG6 where the author embeds let-go on a remarkable 2 android device

yogthos 2026-06-02T19:44:49.814379Z

yeah I've been following that a bit, let-go definitely seems neat, and honestly I regret going with Rust over go for my tool, compilation times get absolutely brutal once you get to 100k loc or so

yogthos 2026-06-02T19:45:24.286509Z

it takes minutes on my machine, so any time I want to do something like a UI change where I need to test and see how it feels, it's a few minutes of waiting for the build

yogthos 2026-06-02T19:45:48.777729Z

but jolt is mostly just to play around to be honest, Janet works well already

borkdude 2026-06-02T19:45:52.781199Z

100k lines ... that's how much Clojure we had with a team of 4 devs of 5 years of writing :)

yogthos 2026-06-02T19:46:20.239969Z

yeah you can produce a ridiculous amount of code once you have LLMs in the loop 🙂

yogthos 2026-06-02T19:46:28.881639Z

to be fair Clojure is a lot more compact than Rust

yogthos 2026-06-02T19:46:49.729269Z

but it's still a chunk of code to be sure

imre 2026-06-02T14:18:42.260229Z

Does babashka have an environment variable like JAVA_TOOL_OPTIONS, where you could list args you want to pass to each invocation of bb?

✅ 1
imre 2026-06-02T14:19:11.869459Z

I'm guessing no because there is no mention of it on http://book.babashka.org but I thought I'd ask

borkdude 2026-06-02T14:19:50.555789Z

no, but there is BABASHKA_PRELUDE which is a code snippets that is invoked on each bb invocation, would that help?

imre 2026-06-02T14:20:11.278409Z

I don't think so, I want to pass -.ssl.trustStore=$JAVA_HOME/lib/security/cacerts 😛

borkdude 2026-06-02T14:20:27.818079Z

does setting the system property work?

borkdude 2026-06-02T14:20:32.255089Z

in BABASHKA_PRELUDE

imre 2026-06-02T14:20:32.554329Z

I suppose I could set the property in code yeah

imre 2026-06-02T14:20:43.274449Z

let me try

borkdude 2026-06-02T14:20:49.268539Z

that particular bit of command line handling is done by graal, babashka can't even access it.

👍 1
imre 2026-06-02T14:21:13.605579Z

I'm wondering if there is a GRAAL env var then...

borkdude 2026-06-02T14:23:39.630729Z

you can see all the available options by following the bb command line

👍 1
imre 2026-06-02T14:24:02.939029Z

thank you

borkdude 2026-06-02T14:24:03.391019Z

Substrate VM opts:

  -D<property>=<value>     Set a system property (e.g. -Dx.y=99).
  -Xmx<size>[g|G|m|M|k|K]  Set a maximum heap size (e.g. -Xmx256M to limit the heap to 256MB).
  -XX:PrintFlags=          Print all Substrate VM options.

borkdude 2026-06-02T14:24:40.654449Z

I guess you could make a bb wrapper bash script on your system

borkdude 2026-06-02T14:24:52.288729Z

which does exec bb -D... &?args

borkdude 2026-06-02T14:24:58.756799Z

(pseudo-bash)

imre 2026-06-02T14:25:11.330859Z

yeah, that could also work

imre 2026-06-02T14:31:00.503709Z

looks like BABASHKA_PRELOADS isn't processed early enough for my usecase Exception in thread "main" java.lang.Exception: Error: Cannot download Clojure tools. Please download manually...

imre 2026-06-02T14:32:28.580349Z

I'll go with the wrapper 🙂

borkdude 2026-06-02T14:34:11.175219Z

wait, this is deps.clj

borkdude 2026-06-02T14:34:40.512369Z

that should be affect by CLJ_JVM_OPTS

borkdude 2026-06-02T14:34:42.717819Z

try that

borkdude 2026-06-02T14:35:19.723919Z

we specifically support that. https://github.com/borkdude/deps.clj/commit/4417bb69a665a6787e3c05b0ab94a3620510fb62

imre 2026-06-02T14:35:30.095819Z

ah

imre 2026-06-02T14:35:32.722859Z

let me try

borkdude 2026-06-02T14:37:16.106629Z

if it doesn't work, I consider it a bug

imre 2026-06-02T14:43:36.503699Z

that works!

🎉 1
imre 2026-06-02T14:46:05.082029Z

CLJ_JVM_OPTS only affects deps.clj and not the bb process that comes after, right?

borkdude 2026-06-02T14:47:41.728849Z

correct

borkdude 2026-06-02T14:48:00.779369Z

the process that downloads the tools jar is a clojure process at the moment

borkdude 2026-06-02T14:48:05.162159Z

eh no

borkdude 2026-06-02T14:48:10.484399Z

but it is a separate process

imre 2026-06-02T14:48:19.344519Z

thank you sir

imre 2026-06-02T14:48:43.671729Z

I've yet to get to the point where I can verify the PRELOADS thing but I'll signal back

borkdude 2026-06-02T14:48:59.384819Z

👍

imre 2026-06-02T15:02:11.446309Z

I'm finding that 1.12.216 broke with-redefs-ing org.httpkit.client/get

imre 2026-06-02T15:03:06.868639Z

let me try and create a minimal repro

imre 2026-06-02T15:07:20.144339Z

bb -e '(with-redefs [org.httpkit.client/get (fn [] :foo)] (org.httpkit.client/get))'
passes with 215 but fails with 216 and above

imre 2026-06-02T15:07:46.134599Z

0.232 ----- Error --------------------------------------------------------------------
0.233 Type:     clojure.lang.ArityException
0.233 Message:  Wrong number of args (0) passed to: babashka.impl.httpkit-client/get
0.233 Location: NO_SOURCE_PATH:1:52
0.233
0.248 ----- Context ------------------------------------------------------------------
0.248 1: (with-redefs [org.httpkit.client/get (fn [] :foo)] (org.httpkit.client/get))
0.248                                                       ^--- Wrong number of args (0) passed to: babashka.impl.httpkit-client/get
0.248
0.249 ----- Stack trace --------------------------------------------------------------
0.249 org.httpkit.client/get      - babashka/impl/httpkit_client.clj:36:1
0.249 user                        - NO_SOURCE_PATH:1:52
0.249 clojure.core/with-redefs-fn - clojure/core.clj:7690:1
0.249 user                        - NO_SOURCE_PATH:1:1
0.249
------

borkdude 2026-06-02T15:14:13.891059Z

can you find one commit that could be related to this change? doesn't ring a bell to me directly

borkdude 2026-06-02T15:15:27.228719Z

you can bisect with clojure -M:babashka/dev ... if you check out bb including submodules and make the right dev alias (can copy paste that here if you want)

borkdude 2026-06-02T15:17:12.421529Z

issue welcome

imre 2026-06-02T15:18:46.829689Z

(I haven't bisected it, just had a spot check through the commits)

borkdude 2026-06-02T15:18:56.035549Z

yeah that may be it

borkdude 2026-06-02T15:19:00.210279Z

not sure, but I'll find it

imre 2026-06-02T15:22:51.297569Z

Thank you! I created https://github.com/babashka/babashka/issues/1979