Fork me on GitHub
Michael W02:05:21

how can I see the current classpath from the repl?


One thing you can perhaps do is that you can read the BABASHKA_CLASSPATH like so (System/getenv "BABASHKA_CLASSPATH") if the classpath is already set prior to running the REPL.


bb also has a ns basbashka.classpath which you can use add to the current ns

Michael W15:05:01

Thanks, and I looked at those, and tried to add a jar both using the env and add-classpath but I still can't import the library. Just trying to get rebel-readline working for a better repl experience. I was hoping to look at the classpath babashka sees so I could compare it to what I was expecting.


What does "can't import the library" mean? Do you get an error, or what?

Michael W15:05:53

Yes it says it can't find it.


how did you contruct BABASHKA_CLASSPATH, what's the value of that?

Michael W15:05:42

[Mon May 18][08:57:35][mwhitford@esmerelda][~/.m2/repository/com/bhauman/rebel-readline/0.1.4] $ BABASHKA_CLASSPATH=/home/mwhitford/.m2/repository/com/bhauman/rebel-readline/0.1.4/rebel-readline-0.1.4.jar bb

Michael W15:05:10

user=> (require 'rebel-readline) clojure.lang.ExceptionInfo: Could not require rebel-readline. [at line 1, column 1]


shouldn't it be something like (require 'rebel-readline.core)?


user=> (require 'rebel-readline.core)
clojure.lang.ExceptionInfo: Unable to resolve classname: org.jline.reader.UserInterruptException [at rebel_readline/core.clj, line , column ]


so the classpath is correct, your namespace in require was wrong


and unfortunately, this does library does not work with bb as you can see.


but you can always use --nrepl-server and connect from your favorite editor. much better than typing in a REPL

Michael W16:05:36

thanks anyways, I'll just use clojure directly


Hi. How has babashka name come to be, what's the history?


@dennisa It's a play on words with bash. Bash is old. Babushka means granny in Russian but also the scarve a granny wears. Babushka is also used as a synonym for matryoshka which is a nested doll, which hints at a Clojure interpreter built in Clojure itself.


But ultimately it just sounds cool.

💯 4

Thanks : ) I can't help noticing that these two statements are not really true : ) "Babushka means granny in Russian but also the scarve a granny wears. Babushka is also used as a synonym for matryoshka which is a nested doll,"


The scarf is schal (like sjal in dutch) or platok. Matrёshka is a dimunitive for a younger girl and one would not call a old woman like that normally


I didn't say people use matryoshka for old woman, but mistakingly for the nested doll.


So you are confusing these two. Babushka -> old woman, headscarve. Babushka -> mistake synonym for matryoshka = nested doll = Clojure in Clojure.


"also known as Babushka dolls" -- this is weird, perhaps a a western marketing term, but never used in Russian.


Yeah, that might be. Babushka has become a fashion word for headscarves in the west, associated with old women, but now also worn by fashionable girls


If you really want to get to the bottom of it: babashka itself also means a bar used in typography to mark connection between words. In Russian. It's true, look it up 😉


"Babushka has become a fashion word for headscarves" I guess you are close here, it's another marketing term but more correct would be 'babushka's head scarf' (platók)


Thanks for clarifying


cool, the word actually exists! I learned smth today 🙂 thanks!

white space with a length of 48 points with a size of 24 , 36 and 58 points . Babashki used during manufacturing of typesetting of printed forms way high print for educational non-printing areas are relatively small space in the table


Yeah. I had trouble finding good dictionary entries though. If you have Russian dictionaries, more details are welcome.


The synonym is a mistake that people often make, it's not the correct synonym, I'm aware of that. What's not true about the first statement?


How can compare current time > 15:00 in bb using eg (def now (java.time.ZonedDateTime/now)) or similar?


yeah, using the java.time API


I have a question, I was trying to build the v0.0.96 tag (need a custom build for a target environment, the pre-built binaries will not work there) and receiving the following build error:

~> script/uberjar
Compiling babashka.impl.csv
Compiling babashka.impl.curl
Syntax error macroexpanding at (curl.clj:1:1).
Execution error (FileNotFoundException) at babashka.impl.curl/loading (curl.clj:1).
Could not locate babashka/curl__init.class, babashka/curl.clj or babashka/curl.cljc on classpath.

Full report at:
Compilation failed: Subprocess failed
Uberjar aborting because jar failed: Compilation failed: Subprocess failed
Error encountered performing task 'do' with profile(s): 'base,system,user,provided,dev,uberjar,xml,yaml,core-async,csv,transit'
Uberjar aborting because jar failed: Compilation failed: Subprocess failed
I was able to build previous versions without issues. Did something in the build process change?


building with graal 20.0.0.r8


@mbjarland Did you pull babashka's submodules?


yes I did a git submodules update --recursive


if that counts


and the submodule is there in babashka.curl?

mbjarland12:05:42 that you mention it it is empty, there is only a src dir. I am sitting on the v0.0.96 tag, i.e. not on a branch etc. Is there something else I should be doing?


╭─mbjarland@suntory ~/projects/clojure/babashka  ‹(v0.0.96)› 
╰─➤ git st
HEAD detached at v0.0.96
nothing to commit, working tree clean
╭─mbjarland@suntory ~/projects/clojure/babashka  ‹(v0.0.96)› 
╰─➤ git submodule update --recursive
╭─mbjarland@suntory ~/projects/clojure/babashka  ‹(v0.0.96)› 
╰─➤ ls -al babashka.curl/src 
total 0
drwxrwxr-x 2 mbjarland mbjarland  6 May 18 13:44 .
drwxrwxr-x 3 mbjarland mbjarland 17 May 18 13:44 ..
╭─mbjarland@suntory ~/projects/clojure/babashka  ‹(v0.0.96)› 


probably me missing something really fundamental here


I can re-clone


fwiw, I did this in a tmp dir:

$ git clone [email protected]:borkdude/babashka.git --recursive
$ cd babashka
$ git checkout v0.0.96
$ ls babashka.curl LICENSE  deps.edn   src        test


ok git submodule weirdness, did this:

╭─mbjarland@suntory ~/projects/clojure/babashka  ‹(v0.0.96)› 
╰─➤ rm -rf babashka.curl                                                                                            1 ↵
╭─mbjarland@suntory ~/projects/clojure/babashka  ‹(v0.0.96)*› 
╰─➤ git submodule update --init babashka.curl
Cloning into '/home/mbjarland/projects/clojure/babashka/babashka.curl'...
Submodule path 'babashka.curl': checked out '82a6571d51abee402e0b40be984420000fe1c08b'
╭─mbjarland@suntory ~/projects/clojure/babashka  ‹(v0.0.96)› 
╰─➤ ls -al babashka.curl/src 
total 0
drwxrwxr-x 3 mbjarland mbjarland  22 May 18 14:46 .
drwxrwxr-x 5 mbjarland mbjarland 140 May 18 14:46 ..
drwxrwxr-x 2 mbjarland mbjarland  22 May 18 14:46 babashka
╭─mbjarland@suntory ~/projects/clojure/babashka  ‹(v0.0.96)› 


now it's there


so never mind, guess my submodules were not initialized for some reason


maybe eventually we'll get rid of the submodules, but for now it's convenient since sci and the other submodules are still in flux


thanks for the help, should have figured this one out myself. While I'm at it, the tag v0.0.96 builds the following jar file:

Created .../babashka/target/babashka-0.0.97-SNAPSHOT.jar
should I be building something different to get the 96 binary?


I think I mistagged it by accident. there were already two new commits on master when I pushed the release button


the released binaries do have the correct version though


ok no worries, I can check out the correct sha


thanks again


sorry for the confusion 🙂


as a side note, I did eventually get the oracle driver working as a bb feature, but it behaved really strangely with (not allowed to close connections etc) so I've abandoned that track at least for now.


maybe I'll try making a pod out of it


I think i’m missing something, but how should I use I was thinking of building a bb script within a repl session


@borkdude one last qustion, I'm often sitting and developing my bb scripts in a jvm clojure repl (intellij/cursive etc) and I would like to conditionally run some forms if the code is run in a jvm repl vs executed using bb. Currently I'm doing things like:

(if (resolve `*input*) in-bb in-jvm-repl) 
this makes me feel slightly dirty and I figured you might have a more supported way of doing this?


@mbjarland that would be the way I think. another way is looking at a system property that is babashka specific. or just don't use *input* in anything other than a one-liner.


might be worth binding an explicit var just for this purpose? Something like *launched-with-babashka*


@mbjarland I'm favoring system properties instead of custom vars, since that works better with linters like clj-kondo as well and doesn't make the script Clojure-incompatible


There's already one called babashka.main


I saw that one, tried to use it but it seemed to be nil in my test:

─➤ bb
Babashka v0.0.96 REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.

user=> (System/getProperty "babashka.main")


that's because you didn't set main with -m


ah, ok so it's conditionally set. I figured it might be useful to have a property which you always know is set if you are in a babashka context


@mbjarland yes and my proposal was a system property instead of a custom var


but just using resolve on babashka.classpath/add-classpath or using a reader conditional #?(:bb true) also works