babashka

https://github.com/babashka/babashka. Also see #sci, #nbb and #babashka-circleci-builds .
jeff tang 2021-04-05T00:23:12.374300Z

https://magicator.com/

az 2021-04-05T03:26:45.376300Z

Hi all, any ideas on how I would get this to work using clojure.java.shell? I’ve tried all the variations I can think of but can’t get the > working

pg_dump -Fc <postgresql://postgres:postgrespassword@localhost:5432/postgres> &gt; dump.sql

borkdude 2021-04-05T07:40:46.376800Z

@limix &gt; is bash syntax, so prepend this with "bash" "-c"

borkdude 2021-04-05T07:54:52.377300Z

@limix you can also use babashka.process which accepts :out &lt;file&gt;

$ bb -e '(babashka.process/sh ["echo" "foo"] {:out (io/file "/tmp/output.txt")})'

borkdude 2021-04-05T09:13:12.378200Z

Babashka news overview of March 2021: https://github.com/babashka/babashka/blob/master/doc/news.md#2021-03

5
2021-04-05T11:49:56.381800Z

What's your preferred way of visualising graphs with babashka? I'm looking for a simple way to visualise graphs based on data retrieved and transformed in babashka.

2021-04-05T11:50:48.382600Z

(simple line graphs and histograms probably fit 95% of the use cases)

borkdude 2021-04-05T11:51:38.383100Z

Ah not graphs as in directed, acyclic graphs, but graphs as in images?

borkdude 2021-04-05T11:51:49.383300Z

charts?

borkdude 2021-04-05T11:53:49.384300Z

Here is an example of someone using vega-lite to do it. https://gist.github.com/vdikan/6b6063d6e1b00a3cd79bc7b3ce3853d6/ It's using the old custom "from scratch" http server, but nowadays you can do this using httpkit. The html could now be done using hiccup.

1
grazfather 2021-04-05T15:01:09.385Z

Check out #data-science

1
borkdude 2021-04-05T15:02:08.385100Z

@mmz ^

az 2021-04-05T15:34:48.385500Z

@borkdude Thanks so much for the reply!

2021-04-05T16:08:28.385700Z

Thank you! That should work :thumbsup::skin-tone-3:

borkdude 2021-04-05T20:08:11.387Z

@grazfather fyi, I'm now experimenting with topological sort and dependencies between tasks: https://github.com/babashka/babashka/discussions/765#discussioncomment-571737

grazfather 2021-04-05T20:09:20.387200Z

awesome

grazfather 2021-04-05T20:17:04.387800Z

is your intent mostly to work with .PHONY like targets, or would you support something that can detect if a task actually needs to run?

grazfather 2021-04-05T20:17:18.388100Z

e.g. if test needs bin, but bin doesn’t run if none of the files have been touched

grazfather 2021-04-05T20:17:40.388600Z

technicall a task could have an attribute that is a ‘needs to run’ predicate

borkdude 2021-04-05T20:35:58.389500Z

@grazfather yes, can easily support that, but you can also write (when ... ...) or (if ... (println "Nothing to do here") yourself

grazfather 2021-04-05T20:36:35.390100Z

true, that’s probably a better idea. Just maybe something for the babashka book (a recipe) rather than baking it into bb itelsf

borkdude 2021-04-05T20:37:46.391300Z

can always add it later, if it turns out to be something people really want, but providing some helper functions like (modified-since? target files) are the foundation I think

👍 1
borkdude 2021-04-05T20:38:31.391800Z

Borrowing ideas from https://github.com/juxt/mach, but leaving some things out which I think you can do yourself in some code, which could be added later into some option as well

grazfather 2021-04-05T20:40:15.392500Z

oh, I have never seen that project

borkdude 2021-04-05T20:41:14.392700Z

it's deprecated

borkdude 2021-04-05T20:43:57.393Z

if you want to play with this, binaries available in #babashka-circleci-builds

grazfather 2021-04-05T22:28:55.393900Z

I might 🙂 I often whip up quick makefiles when I am debugging something just to re do a few steps

grazfather 2021-04-05T22:29:03.394100Z

often in a docker container

grazfather 2021-04-05T22:29:34.394800Z

An easy (if docker ps | grep) to avoid re-starting the container would be awesome