Fork me on GitHub
#babashka
<
2021-12-04
>
borkdude12:12:20

I didn't expect my Advent of Code solution to actually run faster with babashka. https://twitter.com/borkdude/status/1467114395159478277

dabrazhe16:12:53

This is great news. Perhaps it's due to Graal VM? it would be great to run on different machines and collect more datapoints

borkdude16:12:53

yes, definitely GraalVM has optimized something here

wilkerlucio13:12:34

hello, is there a way to tell babashka to use a specific bb.edn file that's not at the same working directory?

borkdude14:12:52

@wilkerlucio The question has come up before, but one difficulty here would be that bb.edn can contain relative :paths - would these paths still be relative to the working directory or to the bb.edn itself?

borkdude14:12:50

The answer currently is no. Just do pushd subdir; bb ... ; popd

wilkerlucio15:12:25

gotcha, thanks man! I've been using the later tecnique, it just feels very tempting to be able to point to the bb.edn file

wilkerlucio15:12:15

about the relative paths, I would assume they are relative to the bb.edn file, maybe bb could have a flag -pwd, which sounds more explicit in the sense the relative paths will be at the bb.edn

borkdude15:12:14

Here is also a technique you can use, if this applies to your situation: https://github.com/babashka/babashka/discussions/1044#discussioncomment-1544956

wilkerlucio15:12:22

cool one 👍

borkdude15:12:14

There is also a discussion here about this topic: https://github.com/babashka/babashka/discussions/869 Feel free to chime in there.

borkdude15:12:43

What Node.js would do: if you would invoke bb subdir/foo.clj it would take the subdir/bb.edn deps into account (but also those upwards to the root)

borkdude15:12:54

but this kind of is at odds with what clojure itself is doing

wilkerlucio15:12:45

yeah, I can feel some odd situations that could come from that

wilkerlucio15:12:35

I'm about to release a blog post on Babashka + Alfred (https://www.alfredapp.com/), my initial motivation was to use there, altough I found something that's even better for the Alfred case, which is just put a bb.edn in the workflow configuration dir, and then a script running inside will pick it correctly

borkdude15:12:23

looking forward to it

borkdude16:12:00

cool! the integration went really smooth there

wilkerlucio16:12:11

yeah, great place to add some inputs and invoke the script, in my daily work I need to generate those cpf/cnpj very often for testing, Im really happy with this setup 🙂

borkdude17:12:14

btw, if the bb.edn location hadn't worked out, there are other ways to set the classpath: • BABASHKA_CLASSPATH= • --classpath ... • (babashka.deps/add-deps ...) • (babashka.classpath/add-classpath ...)

borkdude16:12:43

awesome blog, thank you @wilkerlucio!

🙏 1