This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-15
Channels
- # ai (35)
- # announcements (3)
- # babashka (16)
- # babashka-sci-dev (2)
- # beginners (37)
- # biff (16)
- # calva (5)
- # cider (2)
- # clj-commons (81)
- # clj-kondo (29)
- # cljfx (2)
- # cljs-dev (4)
- # clojars (4)
- # clojure (92)
- # clojure-europe (72)
- # clojure-losangeles (8)
- # clojure-nl (1)
- # clojure-norway (10)
- # clojure-uk (1)
- # clojurescript (20)
- # clojutre (2)
- # conjure (2)
- # data-science (18)
- # datomic (1)
- # emacs (10)
- # fulcro (49)
- # joyride (1)
- # kaocha (23)
- # leiningen (8)
- # lsp (14)
- # meander (5)
- # off-topic (93)
- # polylith (4)
- # re-frame (20)
- # reagent (9)
- # reitit (2)
- # remote-jobs (8)
- # sci (1)
- # shadow-cljs (21)
- # testing (3)
- # vim (27)
- # xtdb (35)
I finally have a use case for using sci
interpretation from within babashka!
I'd like to make bink
link providers more flexible. Right now, the only supported provider is :edn-file
. - read EDN-formatted local file. I'd like to add a :sci-fn
link provider.
Draft for bink
config format:
{:providers {clojure-community {:edn-file
{:path "~/.config/bink/provider/clojure.edn"}}
stuff-from-work {:sci-fn
(fn []
(cheshire.core/parse-string
(slurp "")
keyword))}}}
I asked about the ability to shell interpret Clojure with sci from babashka scripts a while ago, borkdude, and I think your reply was along the lines of "this is not yet supported, but could be considered".
What are your thoughts now?
This is absolutely not urgent. Simply adding link providers for {:slurp-edn {:url ""}}
and {:slurp-json {:url ""}}
would solve all my immediate needs. Shelling out to babashka is another option. Then I could also use all of babashka's default provided namespaces (like json
for cheshire).That's a very good point.
I need to trust the code in the file regardless, so I won't get any security advantages by using sci over load-string
.
I decided to follow up on this track. I've got something working, but I'm not sure it's good for anyone else yet. I can now use this config file:
;; now in ~/.config/dbx/dbx.edn
{:providers {iterbart {:fn (fn []
(:links (cheshire.core/parse-string
(slurp "")
keyword)))
:embark-fn (fn [url]
(babashka.process/process ["firefox" "-new-window" url]))}}}
with this script: https://github.com/teodorlu/play.teod.eu/tree/8048c10f413c1200dfac566e81815fd3ddce8b03/dbx/dbxx.clj
---
I'm going to try using it for a bit myself before moving any further.
The CLI is simple:
dbx provider # list providers
dbx nav # pick provider, then target, then embark
dbx nav PROVIDER # pick target, then embark.
---
https://play.teod.eu/dbx/[email protected]
has been released, which means it's time for the first public announcement! π
https://clojurians.slack.com/archives/C06MAR553/p1663260244298349
This is great stuff! Itβs not immediately clear, so what do I need to do to get my software onto bbin?
Good question
β’ If your project has a deps.edn
file, you can install it using the --git/url
, --mvn/version
, or --local/root
options, which should be familiar if you've used the Clojure CLI tools
β¦ If your project is on GitHub, you can omit --git/url
using the io.github.proj/repo
syntax
β’ If you have a standalone .clj
script, you can push it to GitHub and install it from the raw HTTP URL
β¦ Installing .clj
files from the local filesystem is not implemented yet, but will be supported in the future
Edit: I created a FAQ page with a little more info: https://github.com/babashka/bbin/blob/main/docs/faq.md#how-do-i-get-my-software-onto-bbin
Im trying to setup a babashka task like
{:min-bb-version "0.4.0"
:tasks {fmt (shell "lein zprint $(git ls-files)")}}
but its failing with
Processing file: `$(git
Unable to process file: `$(git because: java.io.FileNotFoundException: `$(git (No such file or directory) Leaving it unchanged!
Processing file: ls-files)`
Unable to process file: ls-files)` because: java.io.FileNotFoundException: ls-files)` (No such file or directory) Leaving it unchanged!
is the shell
fn able to do the expansion for me?@plins No, it doesn't do bash expansion since bb is fully cross platform compatible and bash is not. You can do it like this:
(let [files (str/split-ilnes (:out (shell {:out :string} "git ls-files"))] ...)
or soAn antq
script you can install with bbin:
bbin install
Then run antq --help
or just antq
to see upgradable depsThis issue for installing multiple scripts from a single repo may be relevant for the borkdude/tools
repo: https://github.com/babashka/bbin/issues/18