This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-12-22
Channels
- # adventofcode (12)
- # announcements (6)
- # aws (3)
- # babashka (57)
- # beginners (40)
- # calva (17)
- # clojure-europe (10)
- # clojure-nl (1)
- # clojure-norway (21)
- # clojure-uk (3)
- # clojuredesign-podcast (4)
- # cursive (3)
- # datomic (9)
- # etaoin (5)
- # fulcro (12)
- # hyperfiddle (42)
- # missionary (2)
- # off-topic (11)
- # reagent (6)
- # scittle (131)
- # squint (3)
- # tools-deps (4)
- # uncomplicate (1)
- # vscode (1)
Is java.util.LinkedList not available in babashka? I am trying to use https://github.com/wkok/openai-clojure in babashka but it is complaining about java.util.LinkedList not being resolvable.
I do not see it in the vector here: https://github.com/babashka/babashka/blob/master/src/babashka/impl/classes.clj#L508
This library seems to depend on implementation details of core.async: [clojure.core.async.impl.protocols :as impl] Is that sse.clj namespace necessary to your goals?
when checking out the dependency locally and commenting out the sse namespace I'm able to load it:
$ bb --config deps.edn -e "(require '[wkok.openai-clojure.api :as api])"
PSA: If you were using data.json in bb, 2.4.0 was the last working working. In 2.5.0 definterface
is used which is not supported in SCI/bb. To make JSON code compatible with bb either use macros (if-bb ...)
, reader conditionals or use https://github.com/babashka/json.
❗
I have created https://gist.github.com/leifericf/242fb222966c8cfc8beb04539aaf8fab. Maybe it's helpful to someone. It's not using Babashka-specific things, but I developed it with- and for Babashka and ran it there.
https://github.com/babashka/cli/issues/12
Trying to write a cli program in bb cli, pretty standard subcommand pattern mycli subcommand --option=foo
Is there any example on how can I auto generate help for both subcommands and opts? All I can find is example to generate help for opts, but not subcommands?
maybe i should try https://github.com/hlship/cli-tools😂
If you have a proposal how it should be implemented, happy to add it, but I think there is no one right way to do it
right now I just do it manually for the subcommands and I use the option formatting for options
i don't think there'll ever be a general solution that can fit all werid edge cases. but i'd expect just to write a subcommand table with each command's opts' spec attached, then it'd gave me what you hand crafted for neil there..(maybe a plus one spec for global options)
I expect something like this to land in the next few months, I'm working on some other part of cli first
What’s the reason bb doesn’t support definterface?
could it fake the interface too? maybe, I tried it briefly but ran into some corner cases
with some more effort,
0 failures, 25 errors.
{:test 233, :pass 171, :fail 0, :error 107}
only 25 errors left with data.json 2.5.0 :/Dang, that’s a bummer
I’m surprised that it’s harder to fake the class/interface than for a protocol
This is actually not about the definterface anymore but about doing direct JVM interop on a deftype rather than going through a protocol
oh no, it does have to do with definterface since you don't have a protocol in that case :)
If the definterface was a defprotocol, there wouldn't have been a problem but I think the goal was to squeeze the last bit of performance out of this or so...
Damn, okay. Thanks for looking
The conversation in data-json intrigued me, which is why i asked. I have no use case myself lol
It’s a small incompatibility I’ve noticed before but never dug into
one of the things that makes it harder than protocols is with protocols you can see which namespace a protocol method comes from
for JSON compatibility: https://clojurians.slack.com/archives/CLX41ASCS/p1703248520604689
perhaps I could do one last attempt via the type hint stuff: if the type hint is a (fake) interface, the Java interop should be interpreted as a method call on that interface... perhaps
lol no worries, you don’t owe me anything here. I’m always surprised and impressed by what you pull off that looks impossible
I tried to install babashka on an m1 mac using brew and failed
$ brew install borkdude/brew/babashka
Warning: No available formula or cask with the name "borkdude/brew/babashka".
I was able to brew tap borkdude/brew
just fine, and I can see the formula there, so wondering if this something architecture relatedhere's the git repo: https://github.com/borkdude/homebrew-brew
on an m1:
$ brew install borkdude/brew/babashka
Warning: borkdude/brew/babashka 1.3.186 is already installed and up-to-date.
To reinstall 1.3.186, run:
brew reinstall babashka
and:
$ brew reinstall borkdude/brew/babashka
==> Fetching borkdude/brew/babashka
==> Downloading
Already downloaded: /Users/borkdude/Library/Caches/Homebrew/downloads/16be32333058ff4062d771022c51a44b5f523ae09e3d114ee2929a2dc1ace564--babashka-1.3.186-macos-aarch64.tar.gz
==> Reinstalling borkdude/brew/babashka
🍺 /opt/homebrew/Cellar/babashka/1.3.186: 3 files, 63.7MB, built in 2 seconds
kind of suspecting my brew might be faulty - this machine was copied from an intel machine backup, going to reinstall brew
yeah, that worked
sorry for the noise...
now to just figure out everything I need to reinstall :)
well, maybe? I don't know, might be in a closet somewhere, don't even remember
you could run brew list on there, but usually I just wait until I need something and then install it again, lazy evaluation ftw
oh, I did actually do that before I reinstalled :)
a Brewfile can be handy for this too, but something else to remember to maintain or dump before you really need it https://github.com/Homebrew/homebrew-bundle
I've seen so many problems due to x86->arm brew migration. Completely uninstalling brew is often the best fix