This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-02
Channels
- # aleph (25)
- # announcements (17)
- # aws (2)
- # babashka (72)
- # beginners (44)
- # calva (6)
- # cider (3)
- # clj-kondo (109)
- # cljfx (1)
- # cljsrn (31)
- # clojure (151)
- # clojure-austin (1)
- # clojure-europe (36)
- # clojure-nl (5)
- # clojure-norway (2)
- # clojure-spec (17)
- # clojure-uk (12)
- # clojurescript (74)
- # cursive (57)
- # data-science (1)
- # datascript (28)
- # datomic (40)
- # depstar (15)
- # gratitude (3)
- # helix (3)
- # introduce-yourself (1)
- # joker (1)
- # kaocha (2)
- # leiningen (2)
- # lsp (70)
- # lumo (2)
- # malli (2)
- # meander (4)
- # off-topic (10)
- # polylith (27)
- # quil (4)
- # re-frame (18)
- # reagent (24)
- # ring (4)
- # rum (1)
- # shadow-cljs (102)
- # sql (2)
- # tools-deps (48)
- # web-security (8)
- # xtdb (5)
I don't remember who asked a while ago about image processing stuff in babashka, but now there is #nbb and e.g. rotating an image was pretty easy using jimp
:
https://github.com/borkdude/nbb/blob/main/examples/jimp/example.cljs
@borkdude is http://babashka.org offline?!
that was weird. Now it works.
The Tasks talk https://youtu.be/u5ECoR7KT1Y?t=1281run, clojure use (do (run 'clean) (run 'uberjar))
I assume we could just and well, and perhaps more easily, write it as {:depends [clean uberjar]}
right? Does it execute the dependencies in order (https://book.babashka.org/#_dependencies_between_tasks does not say?)? Though we risk to screw up if we run it with run --parallel
so perhaps a bad idea...
yeah, that's the reason: the task dependencies will be run in order if you don't use --parallel
, but if you do, then there is no defined order
also note that dependency order depends on topological sorting, e.g. :depends [x y z]
doesn't always mean that y is before z, e.g. not if z is also a dependency of x
Question about Fish completions for tasks https://book.babashka.org/#_fish - there is
function __bb_complete_tasks
if not test "$__bb_tasks"
set -g __bb_tasks (bb tasks |tail -n +3 |cut -f1 -d ' ')
end
printf "%s\n" $__bb_tasks
end
so once I run this, the tasks list will be set forever. If I run it again in a different folder, I do not get that folder's tasks but the ones saved previously. Is that intended?Hi @UFBL6R4P3 , you added ☝️ , right? I have fixed mine to simply not use a cache variable, I assume the (bb tasks ...) is fast enough for my needs.
Hi, yes it's me.
I'll try to reproduce and fix this issue 👍
Thx for the feedback
Thank you!
This was contributed by people other than me, I don't know fish, so I hope those people will respond/fix :)
ok! do you remember who?
@borkdude would it be possible to add a link to the https://www.youtube.com/watch?v=u5ECoR7KT1Y slide to the youtube description? 🙏
the slides are here: https://speakerdeck.com/borkdude/babashka-tasks-at-london-clojurians-july-2021 where do you want a link?
in the talk description at youtube. Yes, I guess it is Bruno who must do that 🙏
I think you should ask @bruno.bonacci to update the description, I don't manage that account
FYI again I got an error accessing the book page: > This site can’t be reached > Check if there is a typo in book.babashka.org.DNS_PROBE_FINISHED_NXDOMAIN after a reload it showed up. Something fishy going on with the server(s)...
Hi, I can see Lanterna mentioned in BB book but i can’t see it in https://github.com/babashka/pod-registry what’s the current status? Can it be used? Thanks
@zikajk The current state is a bit experimental I would say. I'm not actively working on it at the moment.
@borkdude Thank you. Ink is looking really interesting - new for me. It may be much better choice than lanterna.
You're welcome to work on the lanterna pod. Afaik this is the main issue left: https://github.com/babashka/clojure-lanterna/issues/3
No, i will target Linux servers. (but i am used to do uberscript on macos before deploying self-contained script to these linux machines)
@zikajk ok, for development, you can just use this one on macOS: https://17-303520083-gh.circle-artifacts.com/0/release/pod-babashka-lanterna-0.0.1-SNAPSHOT-macos-amd64.zip
If it's remotely useful, we could just release the initial, but somewhat not perfect version.
And this is the version that works until I will try to compile it with graalvm if I understand the github issue correctly?
the github issue just identifies something that doesn't work with lanterna 3 which did work with 2
we have an upgraded version of clojure-lanterna in the babashka org to lanterna 3. the original clojure-lanterna library is based on 2
So to back up a little: There is a clojure library called clojure-lanterna. https://github.com/MultiMUD/clojure-lanterna But this uses lanterna 2, while lanterna moved to v3 meanwhile. But the clojure lib seems unmaintained.
Since we didn't want to build a pod on an unmaintained lib, we tried upgraded clojure-lanterna to lanterna v3.
And at the same time we made a tetris game and compiled it to graalvm with both v2 and v3. The v3 one has some problems. While the pod seems to work ok. But this may an issue which needs to be fixed.
But if you get some usefulness out of the pod as it is, then I'm ok with just publishing it as v0.0.1
Basically: just use it and report if there are issues we can fix before v0.0.1 and if it works ok, then we'll also publish it as v0.0.1
i am trying to do something like this with bb and running into issues
clojure --init "/full/path/to/bla.clj" --main bla arg1 arg2
what would be equivalent with bb?we could introduce another flag to make --init
behave like babashka-preloads from a file
could you make an issue where you describe your use case? since the official Clojure has this, I think it makes sense
i use something like this in my one file scripts
#!/bin/sh
#_(-*- clojure -*- sorcery to allow to run this script as executable on Linux/Unix
BABASHKA_PRELOADS="(load-file \"$0\")" exec bb --main bla -- "$@"
#_exec clojure -J-Xms256m -J-Xmx256m -J-client -M --report file --init "$0" --main bla "$@")
(ns bla)
Thank-you for writing babashka
! As a longtime clojure user who hasn't written much clojure in the past 2 years, it was super refreshing to be able to look to bb
for a simple task. Basically, I use a database at work that lacks the ability to output a "record view" where you can see the entire record one at a time, like \x
in postgres. I came up with
cat mytabfile | bb -i ' (let [v (mapv #(clojure.string/split % #"\t") (vec *input*)) header (first v) rows (rest v)] (mapv (fn [row] (println (apply str "\nNEW ROW\n\t" (flatten (interpose "\t" (flatten (interpose "\n" (zipmap header row)))))))) rows ) )'
I'm sure this can be improved, but already it is a nice hack to have. Along these lines, is there a common repo somewhere of cool things folks have done with babashka ?@aaelony Great to hear! There is an examples directory in the repo. I keep track of libs and projects here: https://github.com/babashka/babashka/blob/master/doc/projects.md and there is also this news page: https://github.com/babashka/babashka/blob/master/doc/news.md. There there is also the Show and Tell forum on Github Discussions.