Fork me on GitHub

fyi @borkdude - figured it might be fun to have babashka on apple silicon. Turns out graal support doesn’t seem to be there yet so I initiated some activity on the relevant graal ticket at:


I've been following the discussion, subscribed a while ago. Thank you for looking into it.


yeah : ) to me it seems a bit surprising that the activity level is where it is…I suspect a whole lot of devs will be getting their hands on apple silicon cpus and not having support seems just short sighted. We’ll see where it lands, at least they seem responsive


naturally the main driver for working on getting graal running is babashka : )

brazil-parrot 1

Perhaps they mostly focus on cloud -- consumer electronics isn't where the most money can be saved with native image


maybe…to me the dream of combining the eco system and languages on the jvm with the ability to build native executables is quite a lot bigger than the hype it has (not) been getting


I know right :)


Dominic Freeston writes about how he converted his Cryogen blog to babashka.


^ that's really sweet (both design and code) if you ask me


is there a pattern for using babashka as in interactive part in a pipe? Meaning, you drop into a repl, manipulate the input, and then print the output for use in the next step in the pipeline. For example, say I wanted to do something with a subset of my installed brews, but I’m not 100% sure how to transform the json to a newline delimited list for xargs to process and I want to use the repl to come up with that transformation:

brew info --json=v1 --installed  | bb repl | xargs ... 


and in the repl I read in *input*, etc.


absolutely. you can do this. I recommend using rlwrap bb


it's tricky :)


yeah 🙂. When I try bb drops into a repl and attempts to execute the json as if it were Clojure


the REPL reads from stdin and you cannot have two stdins at the same time


there’s a utility called vipe that drops you into vim in a pipeline with the input (e.g., ls | vipe | xargs ...), maybe I’ll have a look to see how that works


it's probably easier to launch brew from babashka and then read the input, launch repl, etc. all from bb process


having dinner, brb


That’s probably best, rather than spending time to figure out this use case. Thanks 🙂


btw, it looks like vipe is just a simple wrapper that writes stdin to a temp file, launches the editor of your choice with that file as its argument, then reads the file after the editor exits and prints it to stdout


hacked something together based on what vipe was doing


Awesome! Let me give it a spin


Works like a charm:

❯ brew info --json=v1 --installed | ./bipe | xargs which
Evaluate 'stdin' to see piped input.
The last return value is piped to the next command.
Use :repl/quit to quit the REPL.
user=> (-> (json/parse-string stdin) rand-nth (get "name"))
user=> ^D

🎉 2

Is random-uuid not supported in nbb? I’m getting unresolved symbol errors