Fork me on GitHub
Cora (she/her)01:12:38

so should babashka files have the ext "clj"?

Cora (she/her)01:12:45

maybe "clb" instead?

Cora (she/her)01:12:52

I've been using .bb but it's not great


fwiw, there is some precedent for .bb already


i'm not particularly attached though


(i think it will be at least some hours before we hear from borkdude about things ๐Ÿ™‚ )

Cora (she/her)01:12:03

that's fine, I'm just tossing it out into the ether ๐Ÿ™‚


i think it would be nice to have an extension specific to babashka for tooling support. however, there is also the idea of somehow being able to interchangeably use clojure files in some cases. haven't quite figured out whether one or the other is preferable overall or whether it's good to use one in some cases and the other in other.


may be there is no issue at all ๐Ÿ™‚

Cora (she/her)01:12:16

clojurescript can execute some clojure files but has a different extension

Cora (she/her)01:12:21

but it's also a wildly different runtime


to give some background, some tooling (e.g. chlorine for atom) was using the extension to determine what functionality to execute. this turns out to be at least a bit problematic for clojure clr files because they, like jvm clojure, also use .clj. i guess that got decided before reader conditionals where one expresses the use of clojure clr using :cljr...

Cora (she/her)07:12:58

yeah, seems likely

Cora (she/her)07:12:17

I finished up my dotfile symlink script without significant issues

Cora (she/her)07:12:30

and greatly improved over the one I had previously


@corasaurus-hex why is .bb not great, can you explain?


FWIW Iโ€™ve been using .clj for scripts that are portable so people without a bb installation can also run them


On the classpath .bb files have priority over .clj and .cljc. In reader conditionals :bb has priority.


I don't know what he had in mind. The only reason I can find it's that you might want to use a regex .cl+ to match clojure-something files

Cora (she/her)08:12:31

well I was thinking it doesn't fit the theme of clj*

Cora (she/her)08:12:55

but joker uses .joke

Cora (she/her)08:12:17

so maybe it's more scripting language ish to use .bb


Maybe .cl+ extensions are better left to "full" platform implementations


yeah, I don't think we're going to do .cljb or something. it's kind of an unwritten rule to not name your tools after clojure, I think the same might apply to file extensions


I'd say just use .clj or .cljc (reader conditionals) unless there's a reason not to.


I use .bb in the test directory so leiningen won't execute those files


I've been using .bb for files that apply to babashka only and .cljc for common code (like in the clj/cljs situation)


I have a bump-version script here which can be ran with babashka and clojure, so that's why I called it .clj:


What I like about .cljc is that it also indicates that it can be used by multiple platforms. To me .clj only promises to run in Clojure. It could be misleading for cljs readers maybe though


Added a section on known babashka libraries: If you have published any useful ones, feel free to add


Just playing around now. Does this mean loading the http library takes around 50 ms?

โžœ  ~ time bb -e "(prn 1)"
bb -e "(prn 1)"  0.01s user 0.01s system 80% cpu 0.019 total
โžœ  ~ time bb -e "(require '[clj-http.lite.client :as client]) (prn 1)"
bb -e "(require '[clj-http.lite.client :as client]) (prn 1)"  0.04s user 0.02s system 91% cpu 0.066 total
โžœ  ~


think so yes


you can maybe speed it up by removing clojure and some spec stuff from the classpath


as clojure puts it on the classpath by default, but that is not needed for bb


but maybe 50ms isn't too bad


btw, you can still shell out to curl as well, so this is an experimental phase where it's not yet clear what should go into babashka and what shouldn't. so for now it's a library

๐Ÿ‘ 4

$ echo "$(clojure -Sdeps '{:deps {limit-break {:git/url "" :sha "f44ebe45446f0f44f2b73761d102af3da6d0a13e"}}}' -Spath)" | bb -i \
"(->> (str/split (first *input*) (re-pattern (System/getProperty \"path.separator\"))) (remove #(re-find #\"clojure\" %)) (str/join (System/getProperty \"path.separator\")))"


> but maybe 50ms isn't too bad Yes I agree. I can imagine it will grow with bigger libraries, but something to figure out. The GraalVM approach could potentially solve that I guess


if startup time becomes a problem as a result of loading libraries you might as well turn to the JVM instead at that point and pay the 1.5 second startup penalty


or indeed, roll your own binary


The new logo just arrived in time for Christmas!

๐Ÿ‘ 8

Brilliant. BTW in my use case, I donโ€™t convert back to a string as Iโ€™m decoding base64 pdf files. works great too!